Exemple #1
0
        public static void CreateIndices(this IApplicationBuilder app)
        {
            using (var scope = app.ApplicationServices.CreateScope())
            {
                using (IMongoUnitOfWork unitOfWork = scope.ServiceProvider.GetService <IMongoUnitOfWork>())
                {
                    var uniqueIndexOptions = new CreateIndexOptions()
                    {
                        Unique = true
                    };

                    IndexKeysDefinition <DefterLog> idDefinition =
                        new IndexKeysDefinitionBuilder <DefterLog>().Descending(p => p.RequestId);

                    var idIndexModel = new CreateIndexModel <DefterLog>(idDefinition, uniqueIndexOptions);

                    IndexKeysDefinition <DefterLog> name = new IndexKeysDefinitionBuilder <DefterLog>()
                                                           .Descending(p => p.Name);

                    var nameIndexModel = new CreateIndexModel <DefterLog>(name);

                    IndexKeysDefinition <DefterLog> operationName = new IndexKeysDefinitionBuilder <DefterLog>()
                                                                    .Descending(p => p.OperationName);

                    var operationNameIndexModel = new CreateIndexModel <DefterLog>(operationName);

                    unitOfWork.RepositoryManager <DefterLog>().CreateIndices(new[] {
                        idIndexModel,
                        nameIndexModel,
                        operationNameIndexModel
                    });
                }
            }
        }
 public BrushingInformationService(
     IMongoUnitOfWork mongoUnitOfWork,
     ILineMessageService lineMessageService
     )
 {
     _mongoUnitOfWork    = mongoUnitOfWork;
     _lineMessageService = lineMessageService;
 }
Exemple #3
0
 public PatientService(
     IUnitOfWork unitOfWork,
     IMongoUnitOfWork mongoUnitOfWork,
     IUsersService usersService)
 {
     _unitOfWork      = unitOfWork;
     _mongoUnitOfWork = mongoUnitOfWork;
     _usersService    = usersService;
 }
 public DoctorService(
     IUnitOfWork unitOfWork,
     IMongoUnitOfWork mongoUnitOfWork,
     IUsersService usersService
     )
 {
     _unitOfWork      = unitOfWork;
     _mongoUnitOfWork = mongoUnitOfWork;
     _usersService    = usersService;
 }
        public MongoRepository(IMongoUnitOfWork unitofWork, string collectname)
        {
            if (unitofWork == null)
            {
                throw new NullReferenceException("UnitOfWork");
            }

            _database       = unitofWork.Context;
            _collectionName = collectname;
        }
Exemple #6
0
 public OilPriceService(
     ICacheService cacheService,
     IWebScraper webScraper,
     ILineMessageService lineMessageService,
     IMongoUnitOfWork mongoUnitOfWork)
 {
     _cacheService       = cacheService;
     _webScraper         = webScraper;
     _lineMessageService = lineMessageService;
     _mongoUnitOfWork    = mongoUnitOfWork;
 }
Exemple #7
0
 public FundsService
 (
     IWebScraper webScraper,
     ILineMessageService lineMessageService,
     IMongoUnitOfWork mongoUnitOfWork
 )
 {
     _webScraper         = webScraper;
     _lineMessageService = lineMessageService;
     _mongoUnitOfWork    = mongoUnitOfWork;
 }
Exemple #8
0
        public MongoRepository(IMongoUnitOfWork unitOfWork)
        {
            if (!BsonClassMap.IsClassMapRegistered(typeof(T)))
            {
                BsonClassMap.RegisterClassMap <T>(map =>
                {
                    map.AutoMap();
                    map.SetIdMember(map.GetMemberMap(m => m.Key));
                });
            }

            _collection = unitOfWork.Database.GetCollection <T>(typeof(T).Name);
        }
 public ProductService(
     IPublishEndpoint publishEndpoint,
     IRequestClient <TestMessageRequest> client,
     ISQLUnitOfWork unitOfWork, IMapper mapper,
     IMongoUnitOfWork mongoUnitOfWork,
     IProductElasticSearchRepository productElasticSearchRepository)
 {
     _publishEndpoint = publishEndpoint;
     _client          = client;
     _sqlUnitOfWork   = unitOfWork;
     _mapper          = mapper;
     _mongoUnitOfWork = mongoUnitOfWork;
     _productElasticSearchRepository = productElasticSearchRepository;
 }
Exemple #10
0
 public AppointmentService(
     IUnitOfWork unitOfWork,
     IMongoUnitOfWork mongoUnitOfWork,
     IDoctorService doctorService,
     IPatientService patientService,
     IUsersService usersService
     )
 {
     _unitOfWork      = unitOfWork;
     _mongounitOfWork = mongoUnitOfWork;
     _doctorService   = doctorService;
     _patientService  = patientService;
     _usersService    = usersService;
 }
 public MongoDbExampleController(IMongoUnitOfWork unitOfWork)
 {
     UnitOfWork = unitOfWork;
 }
Exemple #12
0
 public AlbumMongoController(IMongoUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
Exemple #13
0
 public DefaultViewComponent(IMongoUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
 public CustomCacheValueProvider(IMongoUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
Exemple #15
0
 public UsersService(
     IMongoUnitOfWork mongoUnitOfWork
     )
 {
     _mongoUnitOfWork = mongoUnitOfWork;
 }
 public SleepInformationService(IMongoUnitOfWork mongoUnitOfWork)
 {
     _mongoUnitOfWork = mongoUnitOfWork;
 }
 public ProductLogRepository(IMongoUnitOfWork unitofwork) : base(unitofwork, "ProductLog")
 {
 }
Exemple #18
0
 public LogManager(IMongoUnitOfWork unitOfWork)
 {
     _unitOfWork = unitOfWork;
 }
 public RabbitMqCommunicator(RabbitMqSettings rabbitMqSettings, IModel rabbitMqChannel, IMongoUnitOfWork mongoUnitOfWork)
 {
     _rabbitMqSettings = rabbitMqSettings;
     _rabbitMqChannel  = rabbitMqChannel;
     _players          = mongoUnitOfWork.GetRepository <PlayerInfo>();
 }
 /// <summary>
 /// Create a new instance
 /// </summary>
 /// <param name="unitOfWork">Associated unit of work</param>
 /// <param name="logger">Associated logger</param>
 public DepartmentAggregateRepository(IMongoUnitOfWork unitOfWork, ILogger logger)
     : base(unitOfWork, logger)
 {
 }
 public ContentCacheValueProvider(IMongoUnitOfWork unitOfWork, IModelComposer <ContentObjectViewModel> composer)
 {
     _unitOfWork = unitOfWork;
     _composer   = composer;
 }
 public MongoRepo(IMongoUnitOfWork unitOfWork) : base(unitOfWork)
 {
 }
 public MgExampleRepo(IMongoUnitOfWork unitOfWork) : base(unitOfWork)
 {
 }