예제 #1
0
        public async Task <LabelObject> UpdateAsync(LabelObject labelObject)
        {
            await _labels.ReplaceOneAsync(lb => lb.Id == labelObject.Id, labelObject);

            var query = _labels.AsQueryable <LabelObject>();

            return(query.FirstOrDefault(e => e.Id == labelObject.Id));
        }
예제 #2
0
        public async Task <LabelObject> InsertAsync(LabelObject labelObject, bool autoSave)
        {
            await _labels.InsertOneAsync(labelObject);

            var query = _labels.AsQueryable();

            return(query.FirstOrDefault(l => l.Id == labelObject.Id));
            //labelObject nu are un Id inainte de a fi introdusa in baza de date??????????????????????
        }