예제 #1
0
 public UserService(IServiceScopeFactory serviceScopeFactory)
     : base()
 {
     this.serviceScopeFactory = serviceScopeFactory;
     using (var scope = this.serviceScopeFactory.CreateScope())
     {
         this.dbContext = scope.ServiceProvider.GetRequiredService <SmartDmsDbContext>();
     }
 }
예제 #2
0
        public async Task <AuditTrail> CreateAuditTrailAsync(SmartDmsDbContext db, User user, string title, string operation, string detail = null)
        {
            AuditTrail at = new AuditTrail()
            {
                Id = Guid.NewGuid(), User = user, Title = title, Operation = operation, Detail = detail, Created = DateTime.Now
            };

            db.AuditTrails.Add(at);
            await db.SaveChangesAsync();

            return(at);
        }
예제 #3
0
 public DocumentRepository(SmartDmsDbContext db)
 {
     _db = db;
 }
예제 #4
0
 public DashboardRepository(SmartDmsDbContext db)
 {
     _db = db;
 }
예제 #5
0
 public UserRepository(SmartDmsDbContext db)
 {
     _db = db;
 }