public async Task <int> GetDataCount() { using (var materialDao = new MaterialDao()) { return(await materialDao.GetAllAsync().CountAsync()); } }
public async Task <bool> ExistsMaterial(Guid materialId) { using (IDAL.Master.IMaterialDao materialDao = new MaterialDao()) { return(await materialDao.GetAllAsync().AnyAsync(m => m.Id == materialId)); } }
public async Task <List <Material> > SearchMaterial(string text) { using (var materialDao = new MaterialDao()) { return(await materialDao.GetAllAsync().Where(m => m.Describe.Contains(text)).ToListAsync()); } }
public async Task <DTO.Master.MaterialDto> GetOneMaterialById(Guid materialId) { using (IDAL.Master.IMaterialDao materialDao = new MaterialDao()) { return(await materialDao.GetAllAsync() .Where(m => m.Id == materialId) .Select(m => new DTO.Master.MaterialDto() { Id = m.Id, Code = m.Code, LargeCategory = m.LargeCategory, SmallCategory = m.SmallCategory, Describe = m.Describe, Unit = m.Unit, Note = m.Note, CreateTime = m.CreateTime, }).FirstAsync()); } }