Example #1
0
        public void AuthorExists()
        {
            using (var context = new LibraryContext(options))
            {
                var service = new LibraryRepository(context);

                Assert.IsTrue(service.AuthorExists(1));
                Assert.IsFalse(service.AuthorExists(0));
            }
        }
Example #2
0
        public IActionResult BlockAuthorCreation(Guid id)
        {
            if (LibraryRepository.AuthorExists(id))
            {
                return(StatusCode(409));
            }

            return(NotFound());
        }