public IHttpActionResult Backend_Product_Get() { BackendProductListViewModel viewmodel = new BackendProductListViewModel(); CateringProductDataController dataCtrl = new CateringProductDataController(); BackendProductListArgs args = new BackendProductListArgs(); try { Int32 TotalItemsCount = 0; viewmodel.FromModel(dataCtrl.FilterList(args, out TotalItemsCount)); viewmodel.Pagination.TotalItemsCount = TotalItemsCount; } catch (Exception ex) { return(Error(viewmodel, ex)); } return(Ok(viewmodel)); }
public static BackendProductListViewModel FromModel(this BackendProductListViewModel viewmodel, IEnumerable <CateringProduct> modelList) { viewmodel.Data.FromModel(modelList); return(viewmodel); }