Esempio n. 1
0
        public virtual IActionResult Get(int Page = 1, int Size = 25, string Order = "{}", [Bind(Prefix = "Select[]")] List <string> Select = null, string Keyword = null, string Filter = "{}")
        {
            try
            {
                ReadResponse <GarmentLeftoverWarehouseStock> read = Service.Read(Page, Size, Order, Select, Keyword, Filter);

                Dictionary <string, object> Result =
                    new ResultFormatter(ApiVersion, General.OK_STATUS_CODE, General.OK_MESSAGE)
                    .Ok(read.Data, Service.MapToViewModel, Page, Size, read.Count, read.Data.Count, read.Order, read.Selected);
                return(Ok(Result));
            }
            catch (Exception e)
            {
                Dictionary <string, object> Result =
                    new ResultFormatter(ApiVersion, General.INTERNAL_ERROR_STATUS_CODE, e.Message)
                    .Fail();
                return(StatusCode(General.INTERNAL_ERROR_STATUS_CODE, Result));
            }
        }