123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using Microsoft.EntityFrameworkCore;
- using MTWorkHR.Core.Entities;
- using MTWorkHR.Core.IDto;
- using MTWorkHR.Core.IRepositories;
- using MTWorkHR.Infrastructure.Entities;
- using MTWorkHR.Infrastructure.DBContext;
- namespace MTWorkHR.Infrastructure.Repositories
- {
- public class TeamUserRepository : Repository<TeamUser>, ITeamUserRepository
- {
- private readonly DbSet<TeamUser> dbSet;
- public TeamUserRepository(HRDataContext context) : base(context)
- {
- dbSet = context.Set<TeamUser>();
- }
- public virtual async Task<TeamUser> AddAsync(TeamUser entity)
- {
- await dbSet.AddAsync(entity);
- return entity;
- }
- public virtual async Task<IList<TeamUser>> AddRangeAsync(IList<TeamUser> entity)
- {
- await dbSet.AddRangeAsync(entity);
- return entity;
- }
- public virtual async Task DeleteAsync(TeamUser entity)
- {
- dbSet.Remove(entity);
- }
- public virtual async Task DeleteAsync(IEnumerable<TeamUser> entities)
- {
- dbSet.RemoveRange(entities);
- }
- }
- }
|