/// <summary>
 /// Initializes a new instance of the <see cref="Repository{TEntity}"/> class.
 /// </summary>
 /// <param name="dbContext">The url shortener database context.</param>
 public Repository(IUrlShortenerContext dbContext)
 {
     this.dbContext = dbContext;
     this.dbSet     = dbContext.Set <TEntity>();
 }
예제 #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnitOfWork"/> class.
 /// </summary>
 /// <param name="dbContext">The database context.</param>
 /// <param name="linkRepository">The link repository.</param>
 public UnitOfWork(IUrlShortenerContext dbContext, IRepository <Link> linkRepository)
 {
     this.dbContext      = dbContext;
     this.LinkRepository = linkRepository;
 }