예제 #1
0
 public UnitOfWork(IGContext _dbContext)
 {
     dbContext                         = _dbContext;
     IG_ServiceRepository              = new IG_ServiceRepository(dbContext);
     IG_Login_ServiceRepository        = new IG_Login_ServiceRepository(dbContext);
     IG_Rating_Login_ServiceRepository = new IG_Rating_Login_ServiceRepository(dbContext);
 }
예제 #2
0
        public void RatingTest()
        {
            var optionsBuilder = new DbContextOptionsBuilder <IGContext>();

            optionsBuilder.UseInMemoryDatabase("IELTS_GiaSu");
            var dbContext = new IGContext(optionsBuilder.Options);
            var dateTime  = DateTime.UtcNow;
            var ratingObj = new IG_Rating_Login_Service
            {
                feedback    = "Hệ thống tốt",
                loginToken  = MD5Generator.CreateMD5(dateTime.ToString()),
                timestamp   = dateTime,
                serviceCode = "IG_VeSinh",
                ratingPoint = 5
            };

            dbContext.IG_Rating_Login_Service.Add(ratingObj);
            var result = dbContext.SaveChanges();

            if (result > 0)
            {
                Assert.Pass();
            }
            else
            {
                Assert.Fail();
            }
        }
예제 #3
0
 public IG_ServiceRepository(IGContext _dbContext) : base(_dbContext)
 {
     dbContext = _dbContext;
 }
예제 #4
0
 public IG_Rating_Login_ServiceRepository(IGContext _dbContext) : base(_dbContext)
 {
     dbContext = _dbContext;
 }
예제 #5
0
 public Repository(IGContext _dbContext)
 {
     dbContext = _dbContext;
     dbSet     = dbContext.Set <T>();
 }