Files
hrynco-ef/HrynCo.DAL.Abstract/Entities/Entity.cs
T
Anatolii Grynchuk d254873172 feat: initial solution with HrynCo.DAL.Abstract and HrynCo.DAL.EF
- HrynCo.DAL.Abstract: IEntity<TId>, Entity base classes, ITransaction, IUnitOfWork
- HrynCo.DAL.EF: EfRepository<TDbContext,TEntity>, EfUnitOfWork<TDbContext>, EfTransactionAdapter
- Directory.Packages.props with centralized EF Core 9.0.5 versions
- TeamCity pipeline YAMLs for general-checks and publish

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-05 18:52:18 +03:00

26 lines
527 B
C#

namespace HrynCo.DAL.Abstract.Entities;
[Serializable]
public abstract class Entity<TId> : IEntity<TId> where TId : struct
{
public TId Id { get; set; }
public DateTimeOffset Created { get; set; }
public DateTimeOffset? Updated { get; set; }
}
[Serializable]
public abstract class Entity : Entity<Guid>
{
protected Entity()
{
Id = Guid.NewGuid();
Created = DateTimeOffset.UtcNow;
}
protected Entity(Guid id)
{
Id = id;
Created = DateTimeOffset.UtcNow;
}
}