private static Author CheckAuthor() { using (ApplicationDbContext context = new ApplicationDbContext()) { AuthorService authorService = new AuthorService(context); return(!authorService.Any() ? authorService.Create(new Author { Name = "Author 1" }) : authorService.FirstOrDefault()); } }