예제 #1
0
        /// <summary>
        /// Add a node
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="node"></param>
        public void AddNode <T>(T node) where T : Node
        {
            // validate entity
            ValidateEntity(node);

            // Record history
            RecordHistory(node);

            // Get relevant collection
            var collection = GetCollection(node);

            collection.InsertOne(node);
            NewEntityAdded?.Invoke(this, node);
        }
예제 #2
0
 public static void RaiseNewEntityAdded()
 {
     NewEntityAdded?.Invoke();
 }