You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
b.RegisterSharpRepository(sharpRepoConfig,null,newRootScopeLifetime(),InstanceSharing.Shared);//default InMemory, instances must be treaded as singletons to work
21
22
// b.RegisterSharpRepository(sharpRepoConfig, "mongoDb"); // for Mongo Db
22
23
// b.RegisterSharpRepository(sharpRepoConfig, "efCore");// for Ef Core
23
24
});
@@ -30,7 +31,8 @@
30
31
31
32
// services.AddTransient<DbContext, ContactContext>(); // needed if you don't write dbContextClass on json configuration
//builder.Services.AddTransient<EmailRepository>(r => new EmailRepository(RepositoryFactory.BuildSharpRepositoryConfiguation(builder.Configuration.GetSection("sharpRepository")), "efCore"));
35
+
builder.Services.AddSingleton<EmailRepository>(r =>newEmailRepository(RepositoryFactory.BuildSharpRepositoryConfiguation(builder.Configuration.GetSection("sharpRepository")),"inMemory"));// will not work as expected it doesn't share same memory repository
0 commit comments