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

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

                this.OnFm2PickAndPlace5305DatumCreated(item);
                this.context.Fm2PickAndPlace5305Data.Add(item);
                this.context.SaveChanges();

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

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

                this.OnFm2PickAndPlace5305DatumUpdated(newItem);
                this.context.Fm2PickAndPlace5305Data.Update(newItem);
                this.context.SaveChanges();

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