Files
mws.backend.dotnet/infrastructure/Persistence/Repositories/RepositoryBase.cs
T

14 lines
456 B
C#
Raw Normal View History

2026-08-13 23:10:22 +07:00
using Microsoft.EntityFrameworkCore;
2026-08-19 23:25:08 +07:00
using mws.backend.dotnet.application.Common.Repositories;
2026-08-13 23:10:22 +07:00
2026-08-19 23:25:08 +07:00
namespace mws.backend.dotnet.infrastructure.Persistence.Repositories;
2026-08-13 23:10:22 +07:00
public abstract class RepositoryBase<T>(AppDbContext db) : IRepository<T> where T : class
{
protected readonly AppDbContext Db = db;
protected DbSet<T> Set => Db.Set<T>();
public void Add(T entity) => Set.Add(entity);
public void Remove(T entity) => Set.Remove(entity);
}