예제 #1
0
        //Override to specify behaviour
        public virtual ModifyEntry GetDiff()
        {
            var ret = new ModifyEntry();

            ret.IdEntry = this.Id;
            this.GetType().GetFields().ForEach(x =>
            {
                var complex = (ComplexType)Attribute.GetCustomAttribute(x, typeof(ComplexType));
                ret.Modifiers.Add(new ModifyField()
                {
                    FieldName  = x.Name,
                    FieldValue = complex == null ? x.GetValue(this).ConvertToString() : complex.ConvertToString(x.GetValue(this))
                });
            });
            return(ret);
        }
예제 #2
0
 public void ApplyDiff(ModifyEntry modify)
 {
     modify.Modifiers.ForEach(x => this.ApplyDiff(x.FieldName, x.FieldValue));
 }