public async Task <int> GetDataCount() { using (var projectDao = new ProjectDao()) { return(await projectDao.GetAllAsync().CountAsync()); } }
public async Task <bool> ExistsProject(Guid projectId) { using (IDAL.Master.IProjectDao projectDao = new ProjectDao()) { return(await projectDao.GetAllAsync().AnyAsync(m => m.Id == projectId)); } }
public async Task <DTO.Master.ProjectDto> GetOneProjectById(Guid projectId) { using (IDAL.Master.IProjectDao projectDao = new ProjectDao()) { return(await projectDao.GetAllAsync() .Where(m => m.Id == projectId) .Select(m => new DTO.Master.ProjectDto() { Name = m.Name, CreateTime = m.CreateTime, }).FirstAsync()); } }
public async Task <DTO.Master.ProjectDto> GetOneProjectById(Guid projectId) { using (IDAL.Master.IProjectDao projectDao = new ProjectDao()) { return(await projectDao.GetAllAsync() .Where(m => m.Id == projectId) .Select(m => new DTO.Master.ProjectDto() { Name = m.Name, WBSCode = m.WBSCode, SmallaProject = m.SmallaProject, SmallWBSCode = m.SmallWBSCode, NitialApprovalFunds = m.NitialApprovalFunds, VoltageGrade = m.VoltageGrade, ProjectDepartment = m.ProjectDepartment, PickingPeople = m.PickingPeople, ContactNumber = m.ContactNumber, CreateTime = m.CreateTime, }).FirstAsync()); } }