using System.Collections.Generic; using System.Linq; using _0_Framework.InfraStructure; using AccountManagement.Application.Contracts.TaskSubject; using AccountManagement.Domain.TaskSubjectAgg; using Microsoft.EntityFrameworkCore; namespace AccountMangement.Infrastructure.EFCore.Repository; public class TaskSubjectRepository:RepositoryBase, ITaskSubjectRepository { private readonly AccountContext _context; public TaskSubjectRepository( AccountContext context) : base(context) { _context = context; } public List GetAll(string search) { var res = _context.TaskSubjects.Select(x => new TaskSubjectViewModel() { Id = x.id, Subject = x.Subject }); //if (!string.IsNullOrWhiteSpace(search)) //{ // res = res.Where(x => x.Subject.Contains(search)); //} return res.ToList(); } public void Remove(long id) { var taskSubject=Get(id); _context.TaskSubjects.Remove(taskSubject); _context.SaveChanges(); } }