public static async Task Seed(AviTrackrDbContext context) { var exists = await context.MyTaskStatuses.AnyAsync(); if (!exists) { context.MyTaskStatuses.Add(new MyTaskStatus { StatusName = "Not Started", StatusDescription = "Have not started the Task" }); context.MyTaskStatuses.Add(new MyTaskStatus { StatusName = "Pending", StatusDescription = "Wait on something else" }); context.MyTaskStatuses.Add(new MyTaskStatus { StatusName = "In Progress", StatusDescription = "The task has started but not yet finished" }); context.MyTaskStatuses.Add(new MyTaskStatus { StatusName = "Done", StatusDescription = "The task is completed." }); context.MyTaskStatuses.Add(new MyTaskStatus { StatusName = "Removed", StatusDescription = "The task is no longer necessary." }); await context.SaveChangesAsync(); } }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, AviTrackrDbContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); app.UseCors("dev"); } Mapper.Initialize(i => i.AddProfiles(typeof(BaseEntity).GetTypeInfo().Assembly)); UserProfileSeed.Seed(context).Wait(); NotificationTypeSeed.Seed(context).Wait(); MyTaskStatusesSeed.Seed(context).Wait(); app.UseAuthentication(); app.UseMvc(); }
public static async Task Seed(AviTrackrDbContext context) { var exists = await context.NotificationTypes.AnyAsync(); if (exists) { return; } context.NotificationTypes.Add(new NotificationType { NotificationTypeName = "Email" }); context.NotificationTypes.Add(new NotificationType { NotificationTypeName = "SMS" }); context.NotificationTypes.Add(new NotificationType { NotificationTypeName = "Alexa" }); await context.SaveChangesAsync(); }
public static async Task Seed(AviTrackrDbContext context) { bool exists = await context.UserProfiles.AnyAsync(); if (exists == false) { context.UserProfiles.Add(new UserProfile() { Email = "*****@*****.**", FirstName = "Steven", LastName = "Moseley", UserPermissions = new List <UserPermission>() { new UserPermission() { Value = "admin" } } }); await context.SaveChangesAsync(); } }
public Handler(AviTrackrDbContext context, IPagingResponseService pagingResponseService) { _context = context; _pagingResponseService = pagingResponseService; }
public Handler(AviTrackrDbContext context) { _context = context; }
public Handler(AviTrackrDbContext context, IMapperWrapper mapperWrapper) { this._context = context; _mapperWrapper = mapperWrapper; }
public ValuesController(IMediator mediator, AviTrackrDbContext context) { _mediator = mediator; _context = context; }