public UserProfileRepositoryTest()
        {
            var options = new DbContextOptionsBuilder <PlaygroundDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            _dbContext = new PlaygroundDbContext(options);

            _dbContext.Users.Add(new ApplicationUser
            {
                Id    = 1,
                Email = "*****@*****.**"
            });

            _dbContext.UserProfiles.Add(new UserProfile
            {
                Id        = 1,
                FirstName = "John",
                LastName  = "Doe",
                AppUserId = 1
            });

            _dbContext.SaveChanges();

            _cache  = new Mock <IDistributedCache>();
            _logger = new Mock <ILogger <UserProfileRepository> >();
        }
예제 #2
0
        public FacilityRepositoryTest()
        {
            var options = new DbContextOptionsBuilder <PlaygroundDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            _dbContext = new PlaygroundDbContext(options);

            _dbContext.Sites.Add(new Site
            {
                Id   = 1,
                Name = "Site 1"
            });

            _dbContext.Facilities.Add(new Facility
            {
                Id     = 1,
                Name   = "Facility 1",
                SiteId = 1
            });

            _dbContext.SaveChanges();

            _cache  = new Mock <IDistributedCache>();
            _logger = new Mock <ILogger <FacilityRepository> >();
        }
예제 #3
0
 public DispatchSubscriptionOrdersTask(PlaygroundDbContext db)
 {
     _db = db;
 }
예제 #4
0
 public RestaurantRepository(PlaygroundDbContext playgroundDbContext)
     : base(playgroundDbContext)
 {
 }
예제 #5
0
 public SiteRepository(PlaygroundDbContext dbContext, IDistributedCache cache, ILogger <SiteRepository> logger)
     : base(dbContext, cache, logger)
 {
 }
예제 #6
0
 public UserStore(PlaygroundDbContext context) : base(context)
 {
 }
 public CuisineRepository(PlaygroundDbContext playgroundDbContext)
     : base(playgroundDbContext)
 {
 }
예제 #8
0
 protected BaseRepository(PlaygroundDbContext dbContext, IDistributedCache cache, ILogger logger)
 {
     Db     = dbContext;
     Cache  = cache;
     Logger = logger;
 }
예제 #9
0
 public RepositoryBase(PlaygroundDbContext dbContext)
 {
     _dbContext = dbContext;
 }