Exemple #1
0
 public Persist(PersistOperation operation)
 {
     this.Operation = operation;
     this.Event     = new PersistEvent()
     {
         ID   = Guid.NewGuid(),
         Name = GetEventName(operation)
     };
 }
Exemple #2
0
 public Persist(PersistOperation operation, string eventName, object source)
 {
     this.Operation = operation;
     this.Event     = new PersistEvent()
     {
         ID     = Guid.NewGuid(),
         Name   = String.IsNullOrWhiteSpace(eventName) ? GetEventName(operation) : eventName,
         Source = source
     };
 }
Exemple #3
0
 public Persist(PersistOperation operation, PersistEvent @event)
 {
     this.Operation = operation;
     this.Event     = @event;
     if (this.Event == null)
     {
         this.Event = new PersistEvent()
         {
             ID     = Guid.NewGuid(),
             Name   = GetEventName(operation),
             Source = null
         };
     }
     else if (String.IsNullOrWhiteSpace(this.Event.Name))
     {
         this.Event.Name = GetEventName(operation);
     }
 }
Exemple #4
0
 private string GetEventName(PersistOperation operation)
 {
     return($"{operation} {typeof(TModel).Name}");
 }