public async Task CreateAsync(Concept concept) { try { var conceptClass = new ConceptClass() { Id = Guid.NewGuid(), CreatedOn = 44, Version = 1 }; await _collection.InsertOneAsync(conceptClass); } catch (MongoWriteException ex) { if (ex.IsUniqueViolation()) { throw Error.UniqueKey(ex); } throw Error.GenericDb(ex); } catch (MongoCommandException ex) { Debug.WriteLine(ex); throw Error.GenericDb(ex); } catch (Exception ex) { Debug.WriteLine(ex); throw; } }
public ConceptClass InsertConceptClass(ConceptClass conceptClass) { var persistenceService = ApplicationContext.Current.GetService <IDataPersistenceService <ConceptClass> >(); if (persistenceService == null) { throw new InvalidOperationException($"{nameof(IDataPersistenceService<ConceptClass>)} not found"); } return(persistenceService.Insert(conceptClass, AuthenticationContext.Current.Principal, TransactionMode.Commit)); }
ConceptClass IConceptRepositoryService.SaveConceptClass(ConceptClass conceptClass) { throw new NotImplementedException(); }
public Concept SaveConceptClass(ConceptClass clazz) { throw new NotImplementedException(); }
public ConceptClass InsertConceptClass(ConceptClass conceptClass) { throw new NotImplementedException(); }