Created
June 6, 2020 20:54
-
-
Save alimozdemir/a838247e2c73bf6c2f7b35faaaa00334 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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