public async Task <GetMenuDTO> GetMenuAsync() { GetMenuDTO menuDto = await AsQueryable() .ProjectTo <GetMenuDTO>() .FirstOrDefaultAsync(); return(menuDto); }
public async Task <GetMenuDTO> GetMenuAsync() { try { var menuRepository = this._unitOfWork.GetRepository <IMenuRepository>(); GetMenuDTO menu = await menuRepository.GetMenuAsync(); return(menu); } catch (Exception ex) { throw new ArgumentException(ExceptionMessages.GetMenuAsyncMessage, ex); } }
public async Task <IActionResult> Index() { GetMenuDTO menu = await this._menuService.GetMenuAsync(); return(this.View(menu)); }