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

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

                this.OnPersistedGrantCreated(item);
                this.context.PersistedGrants.Add(item);
                this.context.SaveChanges();

                return(Created($"odata/DbSinDarEla/PersistedGrants/{item.Key}", item));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
        public IActionResult PutPersistedGrant(string key, [FromBody] Models.DbSinDarEla.PersistedGrant newItem)
        {
            try
            {
                if (!ModelState.IsValid)
                {
                    return(BadRequest(ModelState));
                }

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

                this.OnPersistedGrantUpdated(newItem);
                this.context.PersistedGrants.Update(newItem);
                this.context.SaveChanges();

                var itemToReturn = this.context.PersistedGrants.Where(i => i.Key == key);
                return(new ObjectResult(SingleResult.Create(itemToReturn)));
            }
            catch (Exception ex)
            {
                ModelState.AddModelError("", ex.Message);
                return(BadRequest(ModelState));
            }
        }
 partial void OnPersistedGrantUpdated(Models.DbSinDarEla.PersistedGrant item);