public async Task <TypesMenuResult> GetTypesMenu() { TypesMenuResult result = new TypesMenuResult(); try { GetTypesMenuResult output = await _eatClient.GetTypesMenuAsync(); if (output.ResultCode == -1) { throw new Exception(); } result.TypesMenu = output.TypesMenu?.Select(t => new Classes.TypeMenu { TypeMenuGuid = t.TypeMenuGuid, Code = t.Code, Title = t.Title }).ToList() ?? new List <Classes.TypeMenu>(); } catch (Exception ex) { SetException(result, ex); } return(result); }
public GetTypesMenuResult GetTypesMenu() { GetTypesMenuResult result = new GetTypesMenuResult(); try { result.TypesMenu = db.TypeMenu.ToList(); } catch (Exception ex) { SetException(result, ex); } return(result); }