Exemple #1
0
 public ShortenedUrlController(
     UrlShortenerDbContext dbContext,
     UrlShorteningService urlShorteningService)
 {
     _dbContext            = dbContext;
     _urlShorteningService = urlShorteningService;
 }
        public void SetUp()
        {
            var options = new DbContextOptionsBuilder <UrlShortenerDbContext>()
                          .UseInMemoryDatabase("TestDatabase")
                          .Options;

            dbContext = new UrlShortenerDbContext(options);
        }
Exemple #3
0
 public UserService(
     UrlShortenerDbContext db,
     UserManager <User> userManager,
     IOptions <JwtSettings> jwtSettings)
 {
     this.db          = db;
     this.userManager = userManager;
     this.jwtSettings = jwtSettings.Value;
 }
 public VisitorsController(UrlShortenerDbContext urlShortenerDbContext)
 {
     _urlShortenerDbContext = urlShortenerDbContext;
 }
Exemple #5
0
 /// <summary>
 /// Creates an instance of <see cref="UrlRepository"/>
 /// </summary>
 /// <param name="db">The DB context</param>
 public UrlRepository(UrlShortenerDbContext db)
     : base(db)
 {
 }
Exemple #6
0
 public SqlUrlModelData(UrlShortenerDbContext context)
 {
     _context = context;
 }
Exemple #7
0
 /// <summary>
 /// Creates an instance of <see cref="Repository{TEntity, TKey}"/>
 /// </summary>
 /// <param name="db">The DB context</param>
 public Repository(UrlShortenerDbContext db)
 {
     this.db = db ?? throw new ArgumentNullException(nameof(db));
 }
Exemple #8
0
 public static async Task SeedDatabase(this UrlShortenerDbContext db, RoleManager <UserRole> roleManager)
 {
     await SeedRoles(roleManager);
 }
Exemple #9
0
 public RedirectController(UrlShortenerDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
 public UrlController(UrlShortenerDbContext urlShortenerDbContext)
 {
     _urlShortenerDbContext = urlShortenerDbContext;
 }
 public UrlShortenerService(UrlShortenerDbContext dbContext)
 {
     this.dbContext = dbContext;
 }
Exemple #12
0
 public ShortenController(UrlShortenerDbContext dbContext)
 {
     this.dbContext = dbContext;
 }