public CreateUserHandler(IMainDbContext mainDbContext, IMapper mapper, ISecurityService securityService, IUserRepository userRepository) { _dbContext = mainDbContext; _mapper = mapper; _securityService = securityService; _userRepository = userRepository; }
/// <summary> /// Disposes database context. /// </summary> public virtual void Dispose() { if (_context != null) { _context.Dispose(); _context = null; } }
public GenerateTokenHandler(IMainDbContext mainDbContext, IMapper mapper, ITokenConfiguration tokenConfiguration, ISignInConfiguration signInConfiguration) { _mainDbContext = mainDbContext; _mapper = mapper; _tokenHandler = new JwtSecurityTokenHandler(); _tokenConfiguration = tokenConfiguration; _signInConfiguration = signInConfiguration; }
public AuthenticateUserHandler(IMainDbContext mainDbContext, IMapper mapper, ITokenConfiguration tokenConfiguration, ISignInConfiguration signInConfiguration, IMediator mediator) { _mainDbContext = mainDbContext; _mapper = mapper; _tokenConfiguration = tokenConfiguration; _signInConfiguration = signInConfiguration; _mediator = mediator; }
/// <summary> /// Ensure collections created /// </summary> private static void CreateCollections(IMainDbContext dbContext) { var collections = dbContext.Collections(); if (!collections.Has <Board>()) { dbContext.CreateCollection <Board>(); } if (!collections.Has <Card>()) { dbContext.CreateCollection <Card>(); } if (!collections.Has <Task>()) { dbContext.CreateCollection <Task>(); } if (!collections.Has <Organization>()) { dbContext.CreateCollection <Organization>(); } if (!collections.Has <Project>()) { dbContext.CreateCollection <Project>(); } if (!collections.Has <User>()) { dbContext.CreateCollection <User>(); } if (!collections.Has <ApplicationRole>(name: "Roles")) { dbContext.CreateCollection <ApplicationRole>(name: "Roles"); } }
/// <summary> /// Calls the protected Dispose method. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> public void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { // free other managed objects that implement // IDisposable only try { if (_objectContext != null && _objectContext.Connection.State == ConnectionState.Open) { _objectContext.Connection.Close(); } } catch (ObjectDisposedException ex) { log.Error(ex); // do nothing, the objectContext has already been disposed } if (_dataContext != null) { _dataContext.Dispose(); _dataContext = null; } } // release any unmanaged objects // set the object references to null _disposed = true; }
public TaskRepository(IMainDbContext dbContext) : base(dbContext) { }
public RepositoryBase(IMainDbContext mainDbContext) { _mainDbContext = mainDbContext; }
public CurrencyRepository(IMainDbContext context) { mainDbContext = context; }
public CreditCardRepository(IMainDbContext context) { mainDbContext = context; }
public OrganizationRepository(IMainDbContext dbContext) : base(dbContext) { _organizations = dbContext.GetCollection <Organization>();; }
public AddressRepository(IMainDbContext context) { mainDbContext = context; }
/// <summary> /// Create index for collections /// </summary> private static void CreateIndexes(IMainDbContext dbContext) { #region Task Indexs dbContext.GetCollection <Task>().Indexes.CreateOneAsync(new CreateIndexModel <Task>(Builders <Task> .IndexKeys.Ascending(x => x.Id), new CreateIndexOptions() { Name = "Id", Unique = true })); dbContext.GetCollection <Task>().Indexes.CreateOneAsync(new CreateIndexModel <Task>(Builders <Task> .IndexKeys.Ascending(x => x.CardId), new CreateIndexOptions() { Name = "CardId" })); #endregion #region Card Indexs dbContext.GetCollection <Card>().Indexes.CreateOneAsync(new CreateIndexModel <Card>(Builders <Card> .IndexKeys.Ascending(x => x.Id), new CreateIndexOptions() { Name = "Id", Unique = true })); dbContext.GetCollection <Card>().Indexes.CreateOneAsync(new CreateIndexModel <Card>(Builders <Card> .IndexKeys.Ascending(x => x.BoardId), new CreateIndexOptions() { Name = "BoardId" })); #endregion #region Board Indexs dbContext.GetCollection <Board>().Indexes.CreateOneAsync(new CreateIndexModel <Board>(Builders <Board> .IndexKeys.Ascending(x => x.Id), new CreateIndexOptions() { Name = "Id", Unique = true })); dbContext.GetCollection <Board>().Indexes.CreateOneAsync(new CreateIndexModel <Board>(Builders <Board> .IndexKeys.Ascending(x => x.ProjectId), new CreateIndexOptions() { Name = "ProjectId" })); #endregion #region Project Indexs dbContext.GetCollection <Project>().Indexes.CreateOneAsync(new CreateIndexModel <Project>(Builders <Project> .IndexKeys.Ascending(x => x.Id), new CreateIndexOptions() { Name = "Id", Unique = true })); dbContext.GetCollection <Project>().Indexes.CreateOneAsync(new CreateIndexModel <Project>(Builders <Project> .IndexKeys.Ascending(x => x.OrganizationId), new CreateIndexOptions() { Name = "OrganizationId" })); #endregion #region Organization Indexs dbContext.GetCollection <Organization>().Indexes.CreateOneAsync(new CreateIndexModel <Organization>(Builders <Organization> .IndexKeys.Ascending(x => x.Id), new CreateIndexOptions() { Name = "Id", Unique = true })); dbContext.GetCollection <Organization>().Indexes.CreateOneAsync(new CreateIndexModel <Organization>(Builders <Organization> .IndexKeys.Ascending(x => x.UserId), new CreateIndexOptions() { Name = "UserId" })); #endregion #region User Indexs dbContext.GetCollection <User>().Indexes.CreateOneAsync(new CreateIndexModel <User>(Builders <User> .IndexKeys.Ascending(x => x.Id), new CreateIndexOptions() { Name = "Id", Unique = true })); dbContext.GetCollection <User>().Indexes.CreateOneAsync(new CreateIndexModel <User>(Builders <User> .IndexKeys.Ascending(x => x.UserName), new CreateIndexOptions() { Name = "UserName", Unique = true })); dbContext.GetCollection <User>().Indexes.CreateOneAsync(new CreateIndexModel <User>(Builders <User> .IndexKeys.Ascending(x => x.Email), new CreateIndexOptions() { Name = "Email" })); dbContext.GetCollection <User>().Indexes.CreateOneAsync(new CreateIndexModel <User>(Builders <User> .IndexKeys.Ascending(x => x.PhoneNumber), new CreateIndexOptions() { Name = "PhoneNumber", Unique = false })); dbContext.GetCollection <User>().Indexes.CreateOneAsync(new CreateIndexModel <User>(Builders <User> .IndexKeys.Ascending(x => x.DisplayName), new CreateIndexOptions() { Name = "DisplayName" })); #endregion #region ApplicationRole Indexs dbContext.GetCollection <ApplicationRole>(name: "Roles").Indexes.CreateOneAsync(new CreateIndexModel <ApplicationRole>(Builders <ApplicationRole> .IndexKeys.Ascending(x => x.Id), new CreateIndexOptions() { Name = "Id", Unique = true })); #endregion }
public ResearchFellowRepository(IMainDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public DeleteUserHandler(IMainDbContext mainDbContext, IMapper mapper) { _mainDbContext = mainDbContext; _mapper = mapper; }
public LearningProgramRepository(IMainDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public DocumentService(IMainDbContext dbContext) { _dbContext = dbContext; }
public CreateServiceCommandHandler(IMainDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public BaseRepository(IMainDbContext dbContext) { _dbContext = dbContext; _dbSet = _dbContext.Set <TEntity>(); _dbContext.Database.Log = x => log.Info(x); }
public CreateUserHandler(IMainDbContext mainDbContext, IMapper mapper, ILogger <CreateUserHandler> logger) { _mainDbContext = mainDbContext; _mapper = mapper; _logger = logger; }
public UpdateTenantCommandHandler(IMainDbContext context) { _context = context; }
public Generic(IMainDbContext mainContext) { _mainContext = mainContext; }
//private readonly IUserManager _userManager; public SeedSampleDataCommandHandler(IMainDbContext context)//, IUserManager userManager) { _context = context; //_userManager = userManager; }
public CountryRepository(IMainDbContext context) { mainDbContext = context; }
public DeleteEmployeeCommandHandler(IMainDbContext context) { _context = context; }
public GetUsersListQueryHandler(IMainDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public UserLoginQueryHandler(IMainDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public CreateEmployeeCommandHandler(IMainDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public CreateTenantCommandHandler(IMainDbContext context, IMediator mediator) { _context = context; _mediator = mediator; }
public GetEmployeeListQueryHandler(IMainDbContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public UserRepository(IMainDbContext dbContext) { }