/// <summary> /// Получить список моделей сотрудников /// </summary> /// <returns> Список моделей сотрудников</returns> public async Task <List <EmployeeModel> > GetAllWithDepartment() { using (IDataConnection connection = _connectionFactory.Create()) { return(await connection.From <Employee>() .Join(connection.From <Department>(), employee => employee.DepartmentId, department => department.Id, (employee, department) => new EmployeeModel { Department = department.Name, Address = employee.Address, Birthday = employee.Birthday, Details = employee.Details, Name = employee.Name, Patronymic = employee.Patronymic, Surname = employee.Surname, Id = employee.Id }) .ToListAsync()); } }
/// <summary> /// Получить список значений таблицы /// </summary> /// <returns>Список значений</returns> public async Task <List <TEntity> > GetAll() { using (IDataConnection connection = _connectionFactory.Create()) { return(await connection.From <TEntity>().ToListAsync()); } }
public List <TEntity> GetAll() { using (IDataConnection connection = _connectionFactory.Create()) { return(connection.From <TEntity>().ToList()); } }