Fixing a bug in the sample
When creating a new album an album is not generated - resulting in records being created with Id = 0.
This commit is contained in:
parent
38c5f0c514
commit
50c9a1de51
|
|
@ -68,6 +68,12 @@ namespace MusicStore.Controllers
|
|||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
// TODO [EF] Swap to store generated identity key when supported
|
||||
var nextId = db.Albums.Any()
|
||||
? db.Albums.Max(o => o.AlbumId) + 1
|
||||
: 1;
|
||||
|
||||
album.AlbumId = nextId;
|
||||
db.Albums.Add(album);
|
||||
db.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
KRE_VERSION=0.1-alpha-build-0400
|
||||
KRE_VERSION=0.1-alpha-build-0420
|
||||
KRE_FLAVOR=CORECLR
|
||||
Loading…
Reference in New Issue