mirror of
https://github.com/farcasclaudiu/PracticeCalendar.git
synced 2026-06-22 07:01:16 +03:00
@@ -18,7 +18,7 @@ namespace PracticeCalendar.Infrastructure
|
||||
|
||||
services.AddDbContext(connectionString);
|
||||
services.AddTransient<IEmailSender, FileEmailSender>();
|
||||
services.AddTransient<IDomainEventService, DomainEventService>();
|
||||
services.AddSingleton<IDomainEventService, DomainEventService>();
|
||||
|
||||
services.AddScoped(typeof(IRepository<>), typeof(EfRepository<>));
|
||||
|
||||
|
||||
@@ -56,7 +56,9 @@ namespace PracticeCalendar.Infrastructure.Persistence
|
||||
// Seed, if necessary
|
||||
if (!context.PracticeEvents.Any())
|
||||
{
|
||||
context.PracticeEvents.Add(new PracticeEvent("Event 1", "Event 1 desc"));
|
||||
context.PracticeEvents.Add(new PracticeEvent("Event 1", "Event 1 desc",
|
||||
DateTime.Now.AddHours(-1),
|
||||
DateTime.Now.AddHours(1)));
|
||||
|
||||
await context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user