Esempio n. 1
0
        private bool DoAllPropertiesMatch(Event e)
        {
            if (this.GetType() != e.GetType())
                return false;

            var myProperties = this.GetType().GetProperties().Where(_ => _.Name != "Id");
            var otherProperties = e.GetType().GetProperties().Where(_ => _.Name != "Id");

            if (myProperties.Count() != otherProperties.Count())
                return false;

            foreach (var myProperty in myProperties)
            {
                var otherProperty = otherProperties.SingleOrDefault(_ => _.Name == myProperty.Name);

                if (otherProperty == null)
                    return false;

                if (!myProperty.GetValue(this, null).Equals(otherProperty.GetValue(e, null)))
                    return false;
            }

            return true;
        }
 private static void ProjeziereEreignis(Event Event)
 {
 }
 protected void Dispatch(Event Event)
 {
     _uncommitedEvents.Enqueue(Event);
     ((dynamic)this).Apply((dynamic)Event);
 }
 public void Apply(Event e)
 {
 }