public async Task <StoreItem> GetById(string id) { IMongoCollection <StoreItem> storeItemCollection = mongoService.GetCollection <StoreItem>(); IAsyncCursor <StoreItem> itemCursor = await storeItemCollection.FindAsync(item => item.Id.Equals(id)); return(await itemCursor.FirstOrDefaultAsync()); }
public async Task <IEnumerable <Store> > GetAll() { IMongoCollection <Store> storeCollection = mongoDbService.GetCollection <Store>(); IAsyncCursor <Store> storeCursor = await storeCollection.FindAsync(_ => true); return(storeCursor.ToEnumerable()); }
public async Task <Purchase> GetById(string id) { IMongoCollection <Purchase> purchaseCollection = mongoDbService.GetCollection <Purchase>(); IAsyncCursor <Purchase> purchaseCursor = await purchaseCollection.FindAsync(item => item.Id.Equals(id)); return(await purchaseCursor.FirstOrDefaultAsync()); }
public async Task <Sales> GetById(string id) { IMongoCollection <Sales> salesCollection = mongoDbService.GetCollection <Sales>(); IAsyncCursor <Sales> salesCursor = await salesCollection.FindAsync(item => item.Id.Equals(id)); return(await salesCursor.FirstOrDefaultAsync()); }
public ClientService(IDirectoryDbSettings dbSettings, IMongoService mongoService) { clients = mongoService.GetCollection <ClientModel>(dbSettings.ClientCollectionName); }
public UserService(IDirectoryDbSettings dbSettings, IMongoService mongoService) { users = mongoService.GetCollection <UserModel>(dbSettings.UserCollectionName); }
public AccountService(IDirectoryDbSettings dbSettings, IMongoService mongoService) { managers = mongoService.GetCollection <ManagerModel>(dbSettings.ManagersCollectionName); }