public IActionResult Post([FromBody] Models.Sortimat.HourValue item)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                if (item == null)
                {
                    return(BadRequest());
                }

                this.OnHourValueCreated(item);
                this.context.HourValues.Add(item);
                this.context.SaveChanges();

                return(Created($"odata/Sortimat/HourValues/{item.RowID}", item));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
        public IActionResult PutHourValue(int key, [FromBody] Models.Sortimat.HourValue newItem)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

                if (newItem == null || (newItem.RowID != key))
                {
                    return(BadRequest());
                }

                this.OnHourValueUpdated(newItem);
                this.context.HourValues.Update(newItem);
                this.context.SaveChanges();

                var itemToReturn = this.context.HourValues.Where(i => i.RowID == key);
                return(new ObjectResult(SingleResult.Create(itemToReturn)));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
 partial void OnHourValueUpdated(Models.Sortimat.HourValue item);
 partial void OnHourValueDeleted(Models.Sortimat.HourValue item);