public async Task <TypeDishesResult> GetTypeDishes() { TypeDishesResult result = new TypeDishesResult(); try { GetTypeDishesResult output = await _eatClient.GetTypeDishesAsync(); if (output.ResultCode == -1) { throw new Exception(); } result.TypeDishes = output.TypeDishes?.Select(t => new Classes.TypeDishes { TypeGuid = t.TypeGuid, Code = t.Code, Title = t.Title }).ToList() ?? new List <Classes.TypeDishes>(); } catch (Exception ex) { SetException(result, ex); } return(result); }
public GetTypeDishesResult GetTypeDishes() { GetTypeDishesResult result = new GetTypeDishesResult(); try { result.TypeDishes = db.TypeDishes.ToList(); } catch (Exception ex) { SetException(result, ex); } return(result); }