public void AuthorExists() { using (var context = new LibraryContext(options)) { var service = new LibraryRepository(context); Assert.IsTrue(service.AuthorExists(1)); Assert.IsFalse(service.AuthorExists(0)); } }
public IActionResult BlockAuthorCreation(Guid id) { if (LibraryRepository.AuthorExists(id)) { return(StatusCode(409)); } return(NotFound()); }