private static void AddColoursFeaturesAndStorage(EcommerceStuContext context) { if (context.Colours.Any() == false) { var colours = new List <string>() { "Black", "White", "Gold", "Silver", "Grey", "Spacegrey", "Red", "Pink" }; colours.ForEach(c => context.Add(new Colour { Name = c })); context.SaveChanges(); } if (context.Features.Any() == false) { var features = new List <string>() { "3G", "4G", "Bluetooth", "WiFi", "Fast charge", "GPS", "NFC" }; features.ForEach(f => context.Add(new Feature { Name = f })); context.SaveChanges(); } if (context.Storage.Any() == false) { var storage = new List <string>() { "4GB", "8GB", "16GB", "32GB", "64GB", "128GB", "256GB" }; storage.ForEach(s => context.Storage.Add(new Storage { Capacity = s })); context.SaveChanges(); } }