Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class Bootstrapper
- {
- public static void UseTodoInMemoryDataAccess(this IServiceCollection services, DbConfig config)
- {
- if (services == null || string.IsNullOrWhiteSpace(config?.ConnectionString))
- {
- throw new Exception("Both services and a valid database configuration is required");
- }
- services.AddScoped(provider => config);
- services.AddScoped<ITodoRepository, InMemoryTodoRepository>();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement