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

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

                this.OnSh2Assembly5308PerBatchPerCycleCreated(item);
                this.context.Sh2Assembly5308PerBatchPerCycles.Add(item);
                this.context.SaveChanges();

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

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

                this.OnSh2Assembly5308PerBatchPerCycleUpdated(newItem);
                this.context.Sh2Assembly5308PerBatchPerCycles.Update(newItem);
                this.context.SaveChanges();

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