예제 #1
0
 /// <summary>
 /// Injects books module
 /// </summary>
 /// <param name="services">The service collection</param>
 /// <returns>The updated service collection</returns>
 public static IServiceCollection AddBooks(this IServiceCollection services)
 {
     return(services.AddScoped(x => BooksFactory.CreateRepository(x.GetService <BookShopContext>()))
            .AddScoped(x => BooksFactory.CreateComponent(x.GetService <IBookRepository>())));
 }