Exemplo n.º 1
0
 public async Task<IHttpActionResult> GetGlass(int id)
 {
     var glassDto = await _glassService.GetSingleAsync(id);
     var result = new GlassCompleteDto() { Glasses = new List<GlassDto>() };
     result.Glasses.Add(glassDto);
     return Ok(result);
 }
Exemplo n.º 2
0
 public async Task<GlassCompleteDto> GetGlasses()
 {
     var glassesDto = await _glassService.GetAllAsync();
     var result = new GlassCompleteDto {Glasses = glassesDto.OrderBy(g => g.Name).ToList()};
     return result;
 }
Exemplo n.º 3
0
 public async Task<GlassCompleteDto> GetGlassBySearch(string query, int from = 0, int size = 20)
 {
     var glassesDto = await _glassService.SearchAsync(query, from, size);
     var result = new GlassCompleteDto {Glasses = glassesDto.ToList()};
     return result;
 }