public async Task <IActionResult> ProductsByIds([FromBody] IDsViewModel model) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var result = await _generalService.AllProductsByIds(model); return(new OkObjectResult(result)); }
public async Task <IEnumerable <Product> > AllProductsByIds(IDsViewModel IDs) { return(await _dbContex.Products.Where(X => IDs.Ids.Contains(X.Id)).Include(Y => Y.Category).ToListAsync()); throw new NotImplementedException(); }