- Updated DbRepository constructor to use DbSetFactory<TDbContext, TEntity> instead of a Func<TDbContext, DbSet<TEntity>> queryFactory. - Adjusted namespace imports to include DigitalData.Core.Infrastructure.Factory. - Improved repository instantiation consistency and encapsulation.
17 lines
544 B
C#
17 lines
544 B
C#
using DigitalData.Core.Abstraction.Application.Repository;
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
namespace DigitalData.Core.Tests.Mock;
|
|
|
|
[Table("USER")]
|
|
public class User : UserBase, IEntity
|
|
{
|
|
public required int Id { get; init; }
|
|
|
|
public override int GetHashCode() => HashCode.Combine(Id, FirstName, Email, Age);
|
|
|
|
public override bool Equals(object? obj)
|
|
=> (obj is User user && user.GetHashCode() == GetHashCode())
|
|
|| (obj is UserBase userBase && userBase.GetHashCode() == base.GetHashCode());
|
|
}
|