public new async Task <Entity> GetAsync(string id) { var filter = Builders <Entity> .Filter.Eq("_id", ObjectId.Parse(id)); var projection = Builders <Entity> .Projection.Exclude(e => e.Terms); var entity = await Collection.Find(filter).Project <Entity>(projection).FirstOrDefaultAsync(); entity.Domain = MongoDbUtils.ApostrophesToDots(entity.Domain); return(entity); }
public async Task <Entity> GetByDomainAsync(string domain) { domain = MongoDbUtils.DotsToApostrophes(domain); var filter = Builders <Entity> .Filter.Eq(e => e.Domain, domain); var projection = Builders <Entity> .Projection.Exclude(e => e.Terms); var entity = await Collection.Find(filter).Project <Entity>(projection).FirstAsync(); entity.Domain = MongoDbUtils.ApostrophesToDots(entity.Domain); return(entity); }