public async Task <object> GetCustomerByGroup(string group) { //List<object> Groups = await customergroupRepository.GetCustomerGroupByGroup(group); //return Ok(Groups); List <CustomerGroup> list = await customergroupRepository.GetCustomerGroups(); var customerilist = list.Where(item => item.Group == group).Select(item => item.Customer).Distinct(); return(Ok(customerilist)); }
/// <summary> /// Lấy tất cả danh sách nhóm khách hàng. /// </summary> /// <returns>Danh sách nhóm khách hàng.</returns> public IEnumerable <CustomerGroup> GetCustomerGroups() { var customerGroups = _customerGroupRepository.GetCustomerGroups(); return(customerGroups); }
public async Task <object> GetCustomerGroup() { List <CustomerGroup> list = await customergroupRepository.GetCustomerGroups(); return(Ok(list)); }