public IHttpActionResult GetAllData() { var result = new TransferObj <List <ChoiceObject> >(); var unitCode = _service.GetCurrentUnitCode(); result.Data = _service.Repository.DbSet.Where(x => x.TRANGTHAI == (int)TypeState.USED && x.UNITCODE.Equals(unitCode)).OrderBy(x => x.MAKHACHHANG).Select(x => new ChoiceObject { VALUE = x.MAKHACHHANG, TEXT = x.MAKHACHHANG + " | " + x.TENKHACHHANG, DESCRIPTION = x.TENKHACHHANG, EXTEND_VALUE = x.UNITCODE, ID = x.ID }).ToList(); if (result.Data.Count > 0) { result.Status = true; } else { result.Status = false; } return(Ok(result)); }