Ejemplo n.º 1
0
        public IActionResult Post([FromBody] Models.DbSinDarEla.Ereignisse item)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

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

                this.OnEreignisseCreated(item);
                this.context.Ereignisses.Add(item);
                this.context.SaveChanges();

                var key = item.EreignisID;

                var itemToReturn = this.context.Ereignisses.Where(i => i.EreignisID == key);

                Request.QueryString = Request.QueryString.Add("$expand", "Base,EreignisseArten,EreignisseSonderurlaubArten,Kunden,KundenLeistungArten");

                return(new ObjectResult(SingleResult.Create(itemToReturn))
                {
                    StatusCode = 201
                });
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
Ejemplo n.º 2
0
 partial void OnEreignisseUpdated(Models.DbSinDarEla.Ereignisse item);