//[Route("api/Products/")] public IEnumerable <ProductInfo> Get(uint page = 1, [FromUri] string lang = "en") { var _meta = new ProductsMetaData(_productService.Count, (_productService.Count / _perPage) + 1, (int)page); _meta.AddMetadataToRequest(Request); return(_productService.Get(_perPage, (int)(page - 1) * _perPage, lang)); }
public IEnumerable <ProductInfo> Search([FromUri] string q, [FromUri] uint page = 1, [FromUri] string lang = "en") { var result = _productService.Find(q, _perPage, (int)(page - 1) * _perPage, lang); var dataAmount = _productService.FoundedAmount(q, lang); var _meta = new ProductsMetaData((int)dataAmount, ((int)dataAmount / _perPage) + 1, (int)page); _meta.AddMetadataToRequest(Request); return(result); }