private void SaveData(HttpRequest request) { foreach (var property in _context.SystemInformation) { property.PropertyValue = request.Form[property.PropertyName]; } _context.SaveChanges(); }
private static void SeedPlans(ayushContext context) { if (context.Plans.Any() == false) { context.Plans.Add(new Plan() { Name = "Tier 1" }); context.Plans.Add(new Plan() { Name = "Tier 2" }); context.Plans.Add(new Plan() { Name = "Tier 3" }); context.SaveChanges(); } }
private static void SeedSystemSettings(ayushContext context) { if (context.SystemInformation.Any() == false) { List <SystemInformation> settings = new List <SystemInformation>() { new SystemInformation() { PropertyName = "Name", PropertyValue = "UPCLASS" }, new SystemInformation() { PropertyName = "Address", PropertyValue = "UPCLASS" }, new SystemInformation() { PropertyName = "Email", PropertyValue = "UPCLASS" }, new SystemInformation() { PropertyName = "PhoneNumber1", PropertyValue = "UPCLASS" }, new SystemInformation() { PropertyName = "PhoneNumber2", PropertyValue = "UPCLASS" } }; context.AddRange(settings); context.SaveChanges(); } }