Skip to content

Instantly share code, notes, and snippets.

@alimozdemir
Created June 6, 2020 20:54
Show Gist options
  • Save alimozdemir/a838247e2c73bf6c2f7b35faaaa00334 to your computer and use it in GitHub Desktop.
Save alimozdemir/a838247e2c73bf6c2f7b35faaaa00334 to your computer and use it in GitHub Desktop.
[HttpPatch]
public async Task<IActionResult> Patch([FromODataUri] int key, Delta<vw_Song> model)
{
var instance = model.GetInstance();
var changedProps = model.GetChangedPropertyNames();
if (changedProps.Contains("Status"))
{
await _db.Country_Songs.Where(i => i.SongId == instance.Id)
.UpdateAsync(i => new Country_Songs() { Status = instance.Status });
}
return Updated(instance);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment