Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. public static class Bootstrapper
  2. {
  3. public static void UseTodoInMemoryDataAccess(this IServiceCollection services, DbConfig config)
  4. {
  5. if (services == null || string.IsNullOrWhiteSpace(config?.ConnectionString))
  6. {
  7. throw new Exception("Both services and a valid database configuration is required");
  8. }
  9.  
  10. services.AddScoped(provider => config);
  11. services.AddScoped<ITodoRepository, InMemoryTodoRepository>();
  12. }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement