public void CreateItem(Message item)
        {
            if (item != null)
            {
                item.On = DateTime.Now;
            }

            MongoDBStorage <Message> .CreateItem(_collection, item);
        }
		public async Task SetUpAsync()
		{
			_storage = MongoDBStorageFactory.DefaultInstance;

			await _storage.Revisions.Database.Client.DropDatabaseAsync(
				_storage.Revisions.Database.DatabaseNamespace.DatabaseName);

			await _storage.SetUp();
		}
        public async Task SetUpAsync()
        {
            _storage = MongoDBStorageFactory.DefaultInstance;

            await _storage.Revisions.Database.Client.DropDatabaseAsync(
                _storage.Revisions.Database.DatabaseNamespace.DatabaseName);

            await _storage.SetUp();
        }
예제 #4
0
 public async Task <IEnumerable <User> > GetAllItemsAsync()
 {
     return(await MongoDBStorage <User> .GetAllItemsAsync(_collection));
 }
예제 #5
0
 public void CreateItem(User item)
 {
     MongoDBStorage <User> .CreateItem(_collection, item);
 }
예제 #6
0
 public void UpdateItem(Expression <Func <Catalogues, bool> > predicate, Catalogues item)
 {
     MongoDBStorage <Catalogues> .UpdateItem(_collection, predicate, item);
 }
예제 #7
0
 public async Task <Catalogues> GetItemAsync(Expression <Func <Catalogues, bool> > predicate)
 {
     return(await MongoDBStorage <Catalogues> .GetItemAsync(_collection, predicate));
 }
예제 #8
0
 public void CreateItem(Catalogues item)
 {
     MongoDBStorage <Catalogues> .CreateItem(_collection, item);
 }
예제 #9
0
 public RepositoryBase(IOptions <AppConfig> appConfigs)
 {
     MongoHelper.SetDatabaseDetailsFromConfig(appConfigs);
     MongoDBStorage <T> .Initialize();
 }
예제 #10
0
 static BasicAuthenticationAttribute()
 {
     _storage = MongoDBStorageFactory.DefaultInstance;
 }
 public async Task <bool> RemoveItemAsync(Expression <Func <Message, bool> > predicate)
 {
     return(await MongoDBStorage <Message> .DeleteAsync(_collection, predicate));
 }
 public void UpdateItem(Expression <Func <Message, bool> > predicate, Message item)
 {
     MongoDBStorage <Message> .UpdateItem(_collection, predicate, item);
 }
 public async Task <IEnumerable <Message> > GetItemsAsync(Expression <Func <Message, bool> > predicate)
 {
     return(await MongoDBStorage <Message> .GetItemsAsync(_collection, predicate));
 }
 public CounterController(MongoDBStorage mongoDbStorage)
 {
     _storage = mongoDbStorage;
 }
예제 #15
0
 public async Task <User> GetItemAsync(Expression <Func <User, bool> > predicate)
 {
     return(await MongoDBStorage <User> .GetItemAsync(_collection, predicate));
 }
 static BasicAuthenticationAttribute()
 {
     _storage = new MongoDBStorage();
 }
예제 #17
0
 public void UpdateItem(Expression <Func <User, bool> > predicate, User item)
 {
     MongoDBStorage <User> .UpdateItem(_collection, predicate, item);
 }
 static CounterController()
 {
     _storage = new MongoDBStorage();
 }