public PropertyDetail FindByIgdId(string county, string igdId) { try { if (string.IsNullOrEmpty(county) || string.IsNullOrEmpty(igdId)) { throw new ArgumentNullException(igdId); } var collectionName = county.ToLower() + _current; IMongoCollection <PropertyDetail> collection = CollectionProvider.GetCollection <PropertyDetail>(_database, collectionName); var filter = Builders <PropertyDetail> .Filter.Eq("igdid", igdId.ToUpper()); string query = filter.ToString(); var json = filter.RenderToBsonDocument().ToJson(); var doc = collection.Find <PropertyDetail>(filter).FirstOrDefault(); return(doc ?? null); } catch (Exception ex) { throw new RepositoryException(ex.Message, ex); } }
public PropertyDetail FindByParcelId(string state, string county, string parcelId) { try { if (string.IsNullOrEmpty(state) || string.IsNullOrEmpty(county) || string.IsNullOrEmpty(parcelId)) { throw new ArgumentNullException(parcelId); } var collectionName = county.ToLower() + _current; IMongoCollection <PropertyDetail> collection = CollectionProvider.GetCollection <PropertyDetail>(Database, _current); var filter = Builders <PropertyDetail> .Filter.Eq("parcelid", parcelId); var doc = collection.Find(filter).FirstOrDefault(); return(doc ?? null); } catch (Exception ex) { throw new RepositoryException(ex.Message, ex); } }
public MongoRepository(IMongoDatabase database) { Collection = CollectionProvider.GetCollection <T>(database); Database = database; }
public ProjectFeedRepository() { Database = DatabaseProvider.GetDatabase(); _collection = CollectionProvider.GetCollection <ProjectFeed>(Database); }
public AccountRepository() { Database = DatabaseProvider.GetDatabase(); _collection = CollectionProvider.GetCollection <Account>(Database); }
public BidRepository() { Database = DatabaseProvider.GetDatabase(); _collection = CollectionProvider.GetCollection <Bid>(Database); }