public virtual TModel Create(TModel entity) { AssignAdministrator(entity); Context.Set <TModel>().Add(entity); Context.SaveChanges(); return(entity); }
private void SeedDefaultServiceTypes(BeyondDbContext context) { var decorType = context.ServiceTypes.Add(CreateServiceType("Decor")); var coordinationType = context.ServiceTypes.Add(CreateServiceType("Coordination")); var cateringType = context.ServiceTypes.Add(CreateServiceType("Catering")); var mediaType = context.ServiceTypes.Add(CreateServiceType("Media")); context.SaveChanges(); context.ServiceTypes.Add(CreateServiceType("Draping", decorType.Entity.ServiceTypeId)); context.ServiceTypes.Add(CreateServiceType("Back Drop", decorType.Entity.ServiceTypeId)); context.ServiceTypes.Add(CreateServiceType("Photography", mediaType.Entity.ServiceTypeId)); context.ServiceTypes.Add(CreateServiceType("DJ", mediaType.Entity.ServiceTypeId)); context.ServiceTypes.Add(CreateServiceType("Videography", mediaType.Entity.ServiceTypeId)); context.SaveChanges(); }
private void SeedDefaultProductTypes(BeyondDbContext context) { context.ProductTypes.Add(CreateProductType("Center Piece")); context.ProductTypes.Add(CreateProductType("Back Drop")); context.ProductTypes.Add(CreateProductType("Flower")); context.ProductTypes.Add(CreateProductType("Napkin")); context.ProductTypes.Add(CreateProductType("Decorative")); context.SaveChanges(); }
private void SeedDefaultEventTypes(BeyondDbContext context) { context.EventTypes.Add(CreateEventType("Wedding")); context.EventTypes.Add(CreateEventType("Baby Shower")); context.EventTypes.Add(CreateEventType("Birthday Party")); context.EventTypes.Add(CreateEventType("Social Event")); context.EventTypes.Add(CreateEventType("Private Event")); context.EventTypes.Add(CreateEventType("Bridal Shower")); context.EventTypes.Add(CreateEventType("Proposal")); context.EventTypes.Add(CreateEventType("Sweet Sixteen")); context.EventTypes.Add(CreateEventType("Surprise Party")); context.EventTypes.Add(CreateEventType("Vow Renewal")); context.EventTypes.Add(CreateEventType("Gender Reveal")); context.EventTypes.Add(CreateEventType("Graduation Party")); context.EventTypes.Add(CreateEventType("Welcome Home Party")); context.EventTypes.Add(CreateEventType("Banquet")); context.EventTypes.Add(CreateEventType("Quinceanera")); context.EventTypes.Add(CreateEventType("Promotion")); context.EventTypes.Add(CreateEventType("Retirement")); context.EventTypes.Add(CreateEventType("Other")); context.SaveChanges(); }