Пример #1
0
        public IActionResult Post([FromBody] Models.DbSinDarEla.KundenLeistungen item)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

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

                this.OnKundenLeistungenCreated(item);
                this.context.KundenLeistungens.Add(item);
                this.context.SaveChanges();

                var key = item.KundenLeistungID;

                var itemToReturn = this.context.KundenLeistungens.Where(i => i.KundenLeistungID == key);

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

                return(new ObjectResult(SingleResult.Create(itemToReturn))
                {
                    StatusCode = 201
                });
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
Пример #2
0
 partial void OnKundenLeistungenDeleted(Models.DbSinDarEla.KundenLeistungen item);