React to EF API changes
This commit is contained in:
parent
65f58b98a8
commit
715b744146
|
|
@ -76,8 +76,8 @@ namespace MusicStore.Models
|
||||||
|
|
||||||
public void EmptyCart()
|
public void EmptyCart()
|
||||||
{
|
{
|
||||||
var cartItems = _db.CartItems.Where(cart => cart.CartId == ShoppingCartId);
|
var cartItems = _db.CartItems.Where(cart => cart.CartId == ShoppingCartId).ToArray();
|
||||||
_db.CartItems.RemoveRange(cartItems);
|
_db.CartItems.Remove(cartItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<CartItem> GetCartItems()
|
public List<CartItem> GetCartItems()
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace MvcMusicStore.Models
|
||||||
List<Genre> genres,
|
List<Genre> genres,
|
||||||
List<Artist> artists)
|
List<Artist> artists)
|
||||||
{
|
{
|
||||||
var albums = new List<Album>
|
var albums = new[]
|
||||||
{
|
{
|
||||||
new Album
|
new Album
|
||||||
{
|
{
|
||||||
|
|
@ -3720,12 +3720,12 @@ namespace MvcMusicStore.Models
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
context.Albums.AddRange(albums);
|
context.Albums.Add(albums);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Artist> AddArtists(MusicStoreEntities context)
|
private static List<Artist> AddArtists(MusicStoreEntities context)
|
||||||
{
|
{
|
||||||
var artists = new List<Artist>
|
var artists = new[]
|
||||||
{
|
{
|
||||||
new Artist { Name = "65daysofstatic" },
|
new Artist { Name = "65daysofstatic" },
|
||||||
new Artist { Name = "Aaron Goldberg" },
|
new Artist { Name = "Aaron Goldberg" },
|
||||||
|
|
@ -4032,14 +4032,14 @@ namespace MvcMusicStore.Models
|
||||||
new Artist { Name = "אריק אינשטיין" }
|
new Artist { Name = "אריק אינשטיין" }
|
||||||
};
|
};
|
||||||
|
|
||||||
context.Artists.AddRange(artists);
|
context.Artists.Add(artists);
|
||||||
|
|
||||||
return artists;
|
return artists;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Genre> AddGenres(MusicStoreEntities context)
|
private static List<Genre> AddGenres(MusicStoreEntities context)
|
||||||
{
|
{
|
||||||
var genres = new List<Genre>
|
var genres = new[]
|
||||||
{
|
{
|
||||||
new Genre { Name = "Pop" },
|
new Genre { Name = "Pop" },
|
||||||
new Genre { Name = "Rock" },
|
new Genre { Name = "Rock" },
|
||||||
|
|
@ -4058,7 +4058,7 @@ namespace MvcMusicStore.Models
|
||||||
new Genre { Name = "World" }
|
new Genre { Name = "World" }
|
||||||
};
|
};
|
||||||
|
|
||||||
context.Genres.AddRange(genres);
|
context.Genres.Add(genres);
|
||||||
|
|
||||||
return genres;
|
return genres;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ namespace MvcMusicStore.Models
|
||||||
List<Genre> genres,
|
List<Genre> genres,
|
||||||
List<Artist> artists)
|
List<Artist> artists)
|
||||||
{
|
{
|
||||||
var albums = new List<Album>
|
var albums = new[]
|
||||||
{
|
{
|
||||||
new Album
|
new Album
|
||||||
{
|
{
|
||||||
|
|
@ -3720,12 +3720,12 @@ namespace MvcMusicStore.Models
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
context.Albums.AddRange(albums);
|
context.Albums.Add(albums);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Artist> AddArtists(MusicStoreEntities context)
|
private static List<Artist> AddArtists(MusicStoreEntities context)
|
||||||
{
|
{
|
||||||
var artists = new List<Artist>
|
var artists = new[]
|
||||||
{
|
{
|
||||||
new Artist { Name = "65daysofstatic" },
|
new Artist { Name = "65daysofstatic" },
|
||||||
new Artist { Name = "Aaron Goldberg" },
|
new Artist { Name = "Aaron Goldberg" },
|
||||||
|
|
@ -4032,14 +4032,14 @@ namespace MvcMusicStore.Models
|
||||||
new Artist { Name = "אריק אינשטיין" }
|
new Artist { Name = "אריק אינשטיין" }
|
||||||
};
|
};
|
||||||
|
|
||||||
context.Artists.AddRange(artists);
|
context.Artists.Add(artists);
|
||||||
|
|
||||||
return artists;
|
return artists;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Genre> AddGenres(MusicStoreEntities context)
|
private static List<Genre> AddGenres(MusicStoreEntities context)
|
||||||
{
|
{
|
||||||
var genres = new List<Genre>
|
var genres = new[]
|
||||||
{
|
{
|
||||||
new Genre { Name = "Pop" },
|
new Genre { Name = "Pop" },
|
||||||
new Genre { Name = "Rock" },
|
new Genre { Name = "Rock" },
|
||||||
|
|
@ -4058,7 +4058,7 @@ namespace MvcMusicStore.Models
|
||||||
new Genre { Name = "World" }
|
new Genre { Name = "World" }
|
||||||
};
|
};
|
||||||
|
|
||||||
context.Genres.AddRange(genres);
|
context.Genres.Add(genres);
|
||||||
|
|
||||||
return genres;
|
return genres;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue