public async Task <IHttpActionResult> Get() { try { #region token var header = Request.Headers; if (header.Authorization == null) { return(StatusCode(HttpStatusCode.Unauthorized)); } var token = header.Authorization.Parameter; Employee employee; if (string.IsNullOrWhiteSpace(token) || !TokenManager.ValidateToken(token, out employee)) { return(StatusCode(HttpStatusCode.Unauthorized)); } #endregion List <StoreRes> lstResult = new List <StoreRes>(); var lstData = MemoryInfo.GetAllStore(); foreach (var store in lstData) { if (store.IsDeleted != 1) { var lstEmployees = MemoryInfo.GetListEmployeeByField(store.Id.ToString(), Employee.EmployeeFields.IdStore); lstEmployees.ForEach(x => x.Password = null); StoreRes itemRes = new StoreRes(store, lstEmployees); lstResult.Add(itemRes); } } var res = new RequestErrorCode(true, null, null); res.ListDataResult.AddRange(lstResult); return(Ok(res)); } catch (Exception ex) { Logger.Write(ex.ToString()); } return(BadRequest("Unknow")); }