public UserService(IServiceScopeFactory serviceScopeFactory) : base() { this.serviceScopeFactory = serviceScopeFactory; using (var scope = this.serviceScopeFactory.CreateScope()) { this.dbContext = scope.ServiceProvider.GetRequiredService <SmartDmsDbContext>(); } }
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); }
public DocumentRepository(SmartDmsDbContext db) { _db = db; }
public DashboardRepository(SmartDmsDbContext db) { _db = db; }
public UserRepository(SmartDmsDbContext db) { _db = db; }