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

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

                this.OnKundenKontakteCreated(item);
                this.context.KundenKontaktes.Add(item);
                this.context.SaveChanges();

                var key = item.KundenKontaktID;

                var itemToReturn = this.context.KundenKontaktes.Where(i => i.KundenKontaktID == key);

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

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