Skip to content

Instantly share code, notes, and snippets.

@christiannagel
Last active Aug 21, 2018
Embed
What would you like to do?
Injecting services into the books service
public class BooksService : ItemsService<Book>
{
private readonly IRepository<Book, int> _booksRepository;
public BooksService(
IRepository<Book, int> booksRepository,
ISharedItems<Book> booksItems,
ILoggerFactory loggerFactory)
: base(booksItems, loggerFactory)
{
_booksRepository = booksRepository ?? throw new ArgumentNullException(nameof(booksRepository));
}
//...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment