//protected IAuthorRepository repo; public AuthorRepositoryShould() { var factory = new AuthorDbContextFactory(); AuthorDbContext db = factory.CreateDbContext(null); this.repo = new AuthorRepository(db); }
public List <Author> GetAuthors() { using (var context = new AuthorDbContext()) { return(context.Authors.ToList()); } }
public List <Book> GetBooks() { using (var context = new AuthorDbContext()) { return(context.Books.ToList()); } }
public Author Delete(int id) { using (var context = new AuthorDbContext()) { Author author = context.Authors.Find(id); return(author); } }
public AdminController(IGenomeService genomeService, RoleManager <IdentityRole> roleManager, UserManager <AuthorTestUser> userManager, AuthorDbContext authorDbContext, IHttpContextAccessor httpContextAccessor, SignInManager <AuthorTestUser> signInManager) { this.roleManager = roleManager; this.userManager = userManager; this.authorDbContext = authorDbContext; this.httpContextAccessor = httpContextAccessor; this.signInManager = signInManager; gsv = genomeService; }
public GenomeService(RoleManager <IdentityRole> roleManager, UserManager <AuthorTestUser> userManager, IHttpContextAccessor httpContextAccessor, AuthorDbContext authorDbContext, SignInManager <AuthorTestUser> signInManager) { this.roleManager = roleManager; this.userManager = userManager; this.authorDbContext = authorDbContext; this.httpContextAccessor = httpContextAccessor; this.signInManager = signInManager; dataSeeder = new DataSeeder(); }
public List <Author> EditComplite(Author author) { using (var context = new AuthorDbContext()) { context.Entry(author).State = EntityState.Modified; context.SaveChanges(); return(context.Authors.ToList()); } }
public ResearcherController(IGenomeService genomeService, IFileService fileService, RoleManager <IdentityRole> roleManager, UserManager <AuthorTestUser> userManager, IHttpContextAccessor httpContextAccessor, AuthorDbContext authorDbContext, SignInManager <AuthorTestUser> signInManager, IConfiguration configuration) { this.roleManager = roleManager; this.userManager = userManager; this.httpContextAccessor = httpContextAccessor; this.authorDbContext = authorDbContext; this.configuration = configuration; gsv = genomeService; fsv = fileService; }
public FileService(RoleManager <IdentityRole> roleManager, UserManager <AuthorTestUser> userManager, IHttpContextAccessor httpContextAccessor, AuthorDbContext authorDbContext, SignInManager <AuthorTestUser> signInManager, IConfiguration configuration) { this.roleManager = roleManager; this.userManager = userManager; this.authorDbContext = authorDbContext; this.httpContextAccessor = httpContextAccessor; this.signInManager = signInManager; dataSeeder = new DataSeeder(); this.configuration = configuration; }
public List <Book> Create(Book book) { using (var context = new AuthorDbContext()) { context.Books.Add(book); context.SaveChanges(); return(context.Books.ToList()); } }
public List <Author> Create(Author author) { using (var context = new AuthorDbContext()) { context.Authors.Add(author); context.SaveChanges(); return(context.Authors.ToList()); } }
public List <Author> DeleteConfirmed(int id) { using (var context = new AuthorDbContext()) { Author author = context.Authors.Find(id); context.Authors.Remove(author); context.SaveChanges(); return(context.Authors.ToList()); } }
public BookAuthor(AuthorDbContext context) { _context = context; }
public BaseRepositories(AuthorDbContext context) { _context = context; table = context.Set <TEntity>(); }
public UnitOfWork(AuthorDbContext context) { AuthRepository = new BaseRepositories <Core.Entity.Author>(context); _context = context; }
public AuthorService(AuthorDbContext authorDbContext) { _authorDbContext = authorDbContext; }
public AuthorUnitofWork(AuthorDbContext _db) { db = _db; }
public AuthorController(AuthorDbContext context) { this.context = context; }