diff options
Diffstat (limited to 'Gestor.Model/Model.Domain.Generic')
| -rw-r--r-- | Gestor.Model/Model.Domain.Generic/Diferenca.cs | 36 | ||||
| -rw-r--r-- | Gestor.Model/Model.Domain.Generic/DomainBase.cs | 1067 | ||||
| -rw-r--r-- | Gestor.Model/Model.Domain.Generic/EmailBase.cs | 32 | ||||
| -rw-r--r-- | Gestor.Model/Model.Domain.Generic/EnderecoBase.cs | 128 | ||||
| -rw-r--r-- | Gestor.Model/Model.Domain.Generic/FieldInformation.cs | 30 | ||||
| -rw-r--r-- | Gestor.Model/Model.Domain.Generic/IDomain.cs | 15 | ||||
| -rw-r--r-- | Gestor.Model/Model.Domain.Generic/TelefoneBase.cs | 82 | ||||
| -rw-r--r-- | Gestor.Model/Model.Domain.Generic/ValorOriginal.cs | 30 |
8 files changed, 1420 insertions, 0 deletions
diff --git a/Gestor.Model/Model.Domain.Generic/Diferenca.cs b/Gestor.Model/Model.Domain.Generic/Diferenca.cs new file mode 100644 index 0000000..1d0765f --- /dev/null +++ b/Gestor.Model/Model.Domain.Generic/Diferenca.cs @@ -0,0 +1,36 @@ +using System;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Generic
+{
+ public class Diferenca
+ {
+ public string Campo
+ {
+ get;
+ set;
+ }
+
+ public string Descricao
+ {
+ get;
+ set;
+ }
+
+ public string ValorAnterior
+ {
+ get;
+ set;
+ }
+
+ public string ValorAtual
+ {
+ get;
+ set;
+ }
+
+ public Diferenca()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Generic/DomainBase.cs b/Gestor.Model/Model.Domain.Generic/DomainBase.cs new file mode 100644 index 0000000..beef091 --- /dev/null +++ b/Gestor.Model/Model.Domain.Generic/DomainBase.cs @@ -0,0 +1,1067 @@ +using Gestor.Model.Attributes;
+using Microsoft.CSharp.RuntimeBinder;
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Linq;
+using System.Linq.Expressions;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Generic
+{
+ public abstract class DomainBase : ICloneable
+ {
+ private List<FieldInformation> _originalValues = new List<FieldInformation>();
+
+ public long Id
+ {
+ get;
+ set;
+ }
+
+ protected DomainBase()
+ {
+ }
+
+ public object Clone()
+ {
+ return this.MemberwiseClone();
+ }
+
+ public List<Diferenca> Compare()
+ {
+ List<FieldInformation> properties = this.GetProperties();
+ List<Diferenca> diferencas3 = new List<Diferenca>();
+ PropertyInfo[] propertyInfoArray = this.GetType().GetProperties();
+ this._originalValues.ToList<FieldInformation>().ForEach((FieldInformation x) => {
+ Diferenca diferenca;
+ object target;
+ object obj;
+ object target1;
+ object obj1;
+ object target2;
+ object obj2;
+ object target3;
+ object obj3;
+ Diferenca diferenca1;
+ object target4;
+ object obj4;
+ FieldInformation fieldInformation = properties.FirstOrDefault<FieldInformation>((FieldInformation k) => k.Description == x.Description);
+ if (DomainBase.u003cu003eo__18.u003cu003ep__4 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__4 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u00210 = DomainBase.u003cu003eo__18.u003cu003ep__4.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_4 = DomainBase.u003cu003eo__18.u003cu003ep__4;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__0 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__0 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ !0 _u002101 = DomainBase.u003cu003eo__18.u003cu003ep__0.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_0 = DomainBase.u003cu003eo__18.u003cu003ep__0;
+ FieldInformation fieldInformation1 = fieldInformation;
+ object value = _u002101(u003cu003ep_0, (fieldInformation1 != null ? fieldInformation1.Value : null), null);
+ if (DomainBase.u003cu003eo__18.u003cu003ep__3 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__3 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__3.Target(DomainBase.u003cu003eo__18.u003cu003ep__3, value))
+ {
+ target = value;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__2 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__2 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002102 = DomainBase.u003cu003eo__18.u003cu003ep__2.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_2 = DomainBase.u003cu003eo__18.u003cu003ep__2;
+ object obj5 = value;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__1 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__1 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ target = _u002102(u003cu003ep_2, obj5, DomainBase.u003cu003eo__18.u003cu003ep__1.Target(DomainBase.u003cu003eo__18.u003cu003ep__1, x.Value, null));
+ }
+ if (_u00210(u003cu003ep_4, target))
+ {
+ return;
+ }
+ PropertyInfo propertyInfo = propertyInfoArray.FirstOrDefault<PropertyInfo>((PropertyInfo p) => p.Name == x.Name);
+ bool flag = (propertyInfo == null ? false : propertyInfo.GetCustomAttributes(typeof(ForceLogAttribute), true).Length != 0);
+ if (DomainBase.u003cu003eo__18.u003cu003ep__14 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__14 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002103 = DomainBase.u003cu003eo__18.u003cu003ep__14.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_14 = DomainBase.u003cu003eo__18.u003cu003ep__14;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__5 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__5 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ !0 _u002104 = DomainBase.u003cu003eo__18.u003cu003ep__5.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_5 = DomainBase.u003cu003eo__18.u003cu003ep__5;
+ fieldInformation1 = fieldInformation;
+ object target5 = _u002104(u003cu003ep_5, (fieldInformation1 != null ? fieldInformation1.Value : null), null);
+ if (DomainBase.u003cu003eo__18.u003cu003ep__8 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__8 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__8.Target(DomainBase.u003cu003eo__18.u003cu003ep__8, target5))
+ {
+ obj = target5;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__7 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__7 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002105 = DomainBase.u003cu003eo__18.u003cu003ep__7.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_7 = DomainBase.u003cu003eo__18.u003cu003ep__7;
+ object obj6 = target5;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__6 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__6 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.NotEqual, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ obj = _u002105(u003cu003ep_7, obj6, DomainBase.u003cu003eo__18.u003cu003ep__6.Target(DomainBase.u003cu003eo__18.u003cu003ep__6, x.Value, null));
+ }
+ value = obj;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__13 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__13 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__13.Target(DomainBase.u003cu003eo__18.u003cu003ep__13, value))
+ {
+ target1 = value;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__12 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__12 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 target6 = DomainBase.u003cu003eo__18.u003cu003ep__12.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_12 = DomainBase.u003cu003eo__18.u003cu003ep__12;
+ object obj7 = value;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__11 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__11 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.Not, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002106 = DomainBase.u003cu003eo__18.u003cu003ep__11.Target;
+ CallSite<Func<CallSite, object, object>> u003cu003ep_11 = DomainBase.u003cu003eo__18.u003cu003ep__11;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__10 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__10 = CallSite<Func<CallSite, Type, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "IsNullOrWhiteSpace", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 target7 = DomainBase.u003cu003eo__18.u003cu003ep__10.Target;
+ CallSite<Func<CallSite, Type, object, object>> u003cu003ep_10 = DomainBase.u003cu003eo__18.u003cu003ep__10;
+ Type type = typeof(string);
+ if (DomainBase.u003cu003eo__18.u003cu003ep__9 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__9 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ target1 = target6(u003cu003ep_12, obj7, _u002106(u003cu003ep_11, target7(u003cu003ep_10, type, DomainBase.u003cu003eo__18.u003cu003ep__9.Target(DomainBase.u003cu003eo__18.u003cu003ep__9, x.Value))));
+ }
+ if (_u002103(u003cu003ep_14, target1))
+ {
+ List<Diferenca> diferencas = diferencas3;
+ diferenca = new Diferenca()
+ {
+ Campo = x.Name,
+ Descricao = x.Description
+ };
+ Diferenca diferenca2 = diferenca;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__16 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__16 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 _u002107 = DomainBase.u003cu003eo__18.u003cu003ep__16.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_16 = DomainBase.u003cu003eo__18.u003cu003ep__16;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__15 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__15 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ diferenca2.ValorAnterior = _u002107(u003cu003ep_16, DomainBase.u003cu003eo__18.u003cu003ep__15.Target(DomainBase.u003cu003eo__18.u003cu003ep__15, x.Value));
+ diferenca.ValorAtual = null;
+ diferencas.Add(diferenca);
+ return;
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__26 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__26 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 target8 = DomainBase.u003cu003eo__18.u003cu003ep__26.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_26 = DomainBase.u003cu003eo__18.u003cu003ep__26;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__17 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__17 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.NotEqual, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ target5 = DomainBase.u003cu003eo__18.u003cu003ep__17.Target(DomainBase.u003cu003eo__18.u003cu003ep__17, fieldInformation.Value, null);
+ if (DomainBase.u003cu003eo__18.u003cu003ep__20 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__20 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__20.Target(DomainBase.u003cu003eo__18.u003cu003ep__20, target5))
+ {
+ obj1 = target5;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__19 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__19 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002108 = DomainBase.u003cu003eo__18.u003cu003ep__19.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_19 = DomainBase.u003cu003eo__18.u003cu003ep__19;
+ object obj8 = target5;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__18 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__18 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ obj1 = _u002108(u003cu003ep_19, obj8, DomainBase.u003cu003eo__18.u003cu003ep__18.Target(DomainBase.u003cu003eo__18.u003cu003ep__18, x.Value, null));
+ }
+ value = obj1;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__25 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__25 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__25.Target(DomainBase.u003cu003eo__18.u003cu003ep__25, value))
+ {
+ target2 = value;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__24 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__24 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 target9 = DomainBase.u003cu003eo__18.u003cu003ep__24.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_24 = DomainBase.u003cu003eo__18.u003cu003ep__24;
+ object obj9 = value;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__23 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__23 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.Not, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002109 = DomainBase.u003cu003eo__18.u003cu003ep__23.Target;
+ CallSite<Func<CallSite, object, object>> u003cu003ep_23 = DomainBase.u003cu003eo__18.u003cu003ep__23;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__22 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__22 = CallSite<Func<CallSite, Type, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "IsNullOrWhiteSpace", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 target10 = DomainBase.u003cu003eo__18.u003cu003ep__22.Target;
+ CallSite<Func<CallSite, Type, object, object>> u003cu003ep_22 = DomainBase.u003cu003eo__18.u003cu003ep__22;
+ Type type1 = typeof(string);
+ if (DomainBase.u003cu003eo__18.u003cu003ep__21 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__21 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ target2 = target9(u003cu003ep_24, obj9, _u002109(u003cu003ep_23, target10(u003cu003ep_22, type1, DomainBase.u003cu003eo__18.u003cu003ep__21.Target(DomainBase.u003cu003eo__18.u003cu003ep__21, fieldInformation.Value))));
+ }
+ if (target8(u003cu003ep_26, target2))
+ {
+ List<Diferenca> diferencas1 = diferencas3;
+ diferenca = new Diferenca()
+ {
+ Campo = x.Name,
+ Descricao = x.Description,
+ ValorAnterior = null
+ };
+ Diferenca diferenca3 = diferenca;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__28 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__28 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 _u0021010 = DomainBase.u003cu003eo__18.u003cu003ep__28.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_28 = DomainBase.u003cu003eo__18.u003cu003ep__28;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__27 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__27 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ diferenca3.ValorAtual = _u0021010(u003cu003ep_28, DomainBase.u003cu003eo__18.u003cu003ep__27.Target(DomainBase.u003cu003eo__18.u003cu003ep__27, fieldInformation.Value));
+ diferencas1.Add(diferenca);
+ return;
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__34 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__34 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 target11 = DomainBase.u003cu003eo__18.u003cu003ep__34.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_34 = DomainBase.u003cu003eo__18.u003cu003ep__34;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__31 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__31 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u0021011 = DomainBase.u003cu003eo__18.u003cu003ep__31.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_31 = DomainBase.u003cu003eo__18.u003cu003ep__31;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__29 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__29 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ object obj10 = DomainBase.u003cu003eo__18.u003cu003ep__29.Target(DomainBase.u003cu003eo__18.u003cu003ep__29, fieldInformation.Value);
+ if (DomainBase.u003cu003eo__18.u003cu003ep__30 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__30 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ value = _u0021011(u003cu003ep_31, obj10, DomainBase.u003cu003eo__18.u003cu003ep__30.Target(DomainBase.u003cu003eo__18.u003cu003ep__30, x.Value));
+ if (DomainBase.u003cu003eo__18.u003cu003ep__33 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__33 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__33.Target(DomainBase.u003cu003eo__18.u003cu003ep__33, value))
+ {
+ obj2 = value;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__32 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__32 = CallSite<Func<CallSite, object, bool, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) })));
+ }
+ obj2 = DomainBase.u003cu003eo__18.u003cu003ep__32.Target(DomainBase.u003cu003eo__18.u003cu003ep__32, value, !flag);
+ }
+ if (target11(u003cu003ep_34, obj2))
+ {
+ return;
+ }
+ List<Diferenca> diferencas2 = diferencas3;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__35 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__35 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "GetType", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__18.u003cu003ep__35.Target(DomainBase.u003cu003eo__18.u003cu003ep__35, x.Value) is DateTime)
+ {
+ diferenca = new Diferenca()
+ {
+ Campo = x.Name,
+ Descricao = x.Description
+ };
+ Diferenca diferenca4 = diferenca;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__37 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__37 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 target12 = DomainBase.u003cu003eo__18.u003cu003ep__37.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_37 = DomainBase.u003cu003eo__18.u003cu003ep__37;
+ value = x.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__36 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__36 = CallSite<Func<CallSite, object, string, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ target3 = DomainBase.u003cu003eo__18.u003cu003ep__36.Target(DomainBase.u003cu003eo__18.u003cu003ep__36, value, "G");
+ }
+ else
+ {
+ target3 = null;
+ }
+ diferenca4.ValorAnterior = target12(u003cu003ep_37, target3);
+ Diferenca diferenca5 = diferenca;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__39 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__39 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 _u0021012 = DomainBase.u003cu003eo__18.u003cu003ep__39.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_39 = DomainBase.u003cu003eo__18.u003cu003ep__39;
+ value = fieldInformation.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__38 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__38 = CallSite<Func<CallSite, object, string, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ obj3 = DomainBase.u003cu003eo__18.u003cu003ep__38.Target(DomainBase.u003cu003eo__18.u003cu003ep__38, value, "G");
+ }
+ else
+ {
+ obj3 = null;
+ }
+ diferenca5.ValorAtual = _u0021012(u003cu003ep_39, obj3);
+ diferenca1 = diferenca;
+ }
+ else
+ {
+ diferenca = new Diferenca()
+ {
+ Campo = x.Name,
+ Descricao = x.Description
+ };
+ Diferenca diferenca6 = diferenca;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__41 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__41 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 target13 = DomainBase.u003cu003eo__18.u003cu003ep__41.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_41 = DomainBase.u003cu003eo__18.u003cu003ep__41;
+ value = x.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__40 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__40 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ target4 = DomainBase.u003cu003eo__18.u003cu003ep__40.Target(DomainBase.u003cu003eo__18.u003cu003ep__40, value);
+ }
+ else
+ {
+ target4 = null;
+ }
+ diferenca6.ValorAnterior = target13(u003cu003ep_41, target4);
+ Diferenca diferenca7 = diferenca;
+ if (DomainBase.u003cu003eo__18.u003cu003ep__43 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__43 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 _u0021013 = DomainBase.u003cu003eo__18.u003cu003ep__43.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_43 = DomainBase.u003cu003eo__18.u003cu003ep__43;
+ value = fieldInformation.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__18.u003cu003ep__42 == null)
+ {
+ DomainBase.u003cu003eo__18.u003cu003ep__42 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ obj4 = DomainBase.u003cu003eo__18.u003cu003ep__42.Target(DomainBase.u003cu003eo__18.u003cu003ep__42, value);
+ }
+ else
+ {
+ obj4 = null;
+ }
+ diferenca7.ValorAtual = _u0021013(u003cu003ep_43, obj4);
+ diferenca1 = diferenca;
+ }
+ diferencas2.Add(diferenca1);
+ });
+ return diferencas3;
+ }
+
+ public List<Diferenca> Compare(List<ValorOriginal> valoresOriginais)
+ {
+ List<FieldInformation> properties = this.GetProperties();
+ List<Diferenca> diferencas2 = new List<Diferenca>();
+ PropertyInfo[] propertyInfoArray = this.GetType().GetProperties();
+ valoresOriginais.ForEach((ValorOriginal x) => {
+ Diferenca diferenca;
+ object target;
+ object obj;
+ object target1;
+ object obj1;
+ object target2;
+ object obj2;
+ object target3;
+ object obj3;
+ object target4;
+ Diferenca diferenca1;
+ string str;
+ object obj4;
+ FieldInformation fieldInformation = properties.First<FieldInformation>((FieldInformation k) => k.Name == x.Campo);
+ if (DomainBase.u003cu003eo__19.u003cu003ep__3 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__3 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u00210 = DomainBase.u003cu003eo__19.u003cu003ep__3.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_3 = DomainBase.u003cu003eo__19.u003cu003ep__3;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__0 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__0 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ object value = DomainBase.u003cu003eo__19.u003cu003ep__0.Target(DomainBase.u003cu003eo__19.u003cu003ep__0, fieldInformation.Value, null);
+ if (DomainBase.u003cu003eo__19.u003cu003ep__2 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__2 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__2.Target(DomainBase.u003cu003eo__19.u003cu003ep__2, value))
+ {
+ target = value;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__1 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__1 = CallSite<Func<CallSite, object, bool, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) })));
+ }
+ target = DomainBase.u003cu003eo__19.u003cu003ep__1.Target(DomainBase.u003cu003eo__19.u003cu003ep__1, value, x.ValorAtual == null);
+ }
+ if (_u00210(u003cu003ep_3, target))
+ {
+ return;
+ }
+ PropertyInfo propertyInfo = propertyInfoArray.FirstOrDefault<PropertyInfo>((PropertyInfo p) => p.Name == x.Campo);
+ bool flag = (propertyInfo == null ? false : propertyInfo.GetCustomAttributes(typeof(ForceLogAttribute), true).Length != 0);
+ if (DomainBase.u003cu003eo__19.u003cu003ep__9 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__9 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002101 = DomainBase.u003cu003eo__19.u003cu003ep__9.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_9 = DomainBase.u003cu003eo__19.u003cu003ep__9;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__4 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__4 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ object target5 = DomainBase.u003cu003eo__19.u003cu003ep__4.Target(DomainBase.u003cu003eo__19.u003cu003ep__4, fieldInformation.Value, null);
+ if (DomainBase.u003cu003eo__19.u003cu003ep__6 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__6 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__6.Target(DomainBase.u003cu003eo__19.u003cu003ep__6, target5))
+ {
+ obj = target5;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__5 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__5 = CallSite<Func<CallSite, object, bool, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) })));
+ }
+ obj = DomainBase.u003cu003eo__19.u003cu003ep__5.Target(DomainBase.u003cu003eo__19.u003cu003ep__5, target5, x.ValorAtual != null);
+ }
+ value = obj;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__8 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__8 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__8.Target(DomainBase.u003cu003eo__19.u003cu003ep__8, value))
+ {
+ target1 = value;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__7 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__7 = CallSite<Func<CallSite, object, bool, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) })));
+ }
+ target1 = DomainBase.u003cu003eo__19.u003cu003ep__7.Target(DomainBase.u003cu003eo__19.u003cu003ep__7, value, !string.IsNullOrWhiteSpace(x.ValorAtual));
+ }
+ if (_u002101(u003cu003ep_9, target1))
+ {
+ diferencas2.Add(new Diferenca()
+ {
+ Campo = x.Campo,
+ Descricao = fieldInformation.Description,
+ ValorAnterior = x.ValorAtual,
+ ValorAtual = null
+ });
+ return;
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__18 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__18 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002102 = DomainBase.u003cu003eo__19.u003cu003ep__18.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_18 = DomainBase.u003cu003eo__19.u003cu003ep__18;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__10 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__10 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.NotEqual, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ target5 = DomainBase.u003cu003eo__19.u003cu003ep__10.Target(DomainBase.u003cu003eo__19.u003cu003ep__10, fieldInformation.Value, null);
+ if (DomainBase.u003cu003eo__19.u003cu003ep__12 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__12 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__12.Target(DomainBase.u003cu003eo__19.u003cu003ep__12, target5))
+ {
+ obj1 = target5;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__11 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__11 = CallSite<Func<CallSite, object, bool, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) })));
+ }
+ obj1 = DomainBase.u003cu003eo__19.u003cu003ep__11.Target(DomainBase.u003cu003eo__19.u003cu003ep__11, target5, x.ValorAtual == null);
+ }
+ value = obj1;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__17 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__17 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__17.Target(DomainBase.u003cu003eo__19.u003cu003ep__17, value))
+ {
+ target2 = value;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__16 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__16 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002103 = DomainBase.u003cu003eo__19.u003cu003ep__16.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_16 = DomainBase.u003cu003eo__19.u003cu003ep__16;
+ object obj5 = value;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__15 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__15 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.Not, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002104 = DomainBase.u003cu003eo__19.u003cu003ep__15.Target;
+ CallSite<Func<CallSite, object, object>> u003cu003ep_15 = DomainBase.u003cu003eo__19.u003cu003ep__15;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__14 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__14 = CallSite<Func<CallSite, Type, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "IsNullOrWhiteSpace", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.IsStaticType, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002105 = DomainBase.u003cu003eo__19.u003cu003ep__14.Target;
+ CallSite<Func<CallSite, Type, object, object>> u003cu003ep_14 = DomainBase.u003cu003eo__19.u003cu003ep__14;
+ Type type = typeof(string);
+ if (DomainBase.u003cu003eo__19.u003cu003ep__13 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__13 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ target2 = _u002103(u003cu003ep_16, obj5, _u002104(u003cu003ep_15, _u002105(u003cu003ep_14, type, DomainBase.u003cu003eo__19.u003cu003ep__13.Target(DomainBase.u003cu003eo__19.u003cu003ep__13, fieldInformation.Value))));
+ }
+ if (_u002102(u003cu003ep_18, target2))
+ {
+ List<Diferenca> diferencas = diferencas2;
+ diferenca = new Diferenca()
+ {
+ Campo = x.Campo,
+ Descricao = fieldInformation.Description,
+ ValorAnterior = null
+ };
+ Diferenca diferenca2 = diferenca;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__20 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__20 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 target6 = DomainBase.u003cu003eo__19.u003cu003ep__20.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_20 = DomainBase.u003cu003eo__19.u003cu003ep__20;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__19 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__19 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ diferenca2.ValorAtual = target6(u003cu003ep_20, DomainBase.u003cu003eo__19.u003cu003ep__19.Target(DomainBase.u003cu003eo__19.u003cu003ep__19, fieldInformation.Value));
+ diferencas.Add(diferenca);
+ return;
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__28 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__28 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 _u002106 = DomainBase.u003cu003eo__19.u003cu003ep__28.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_28 = DomainBase.u003cu003eo__19.u003cu003ep__28;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__21 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__21 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.NotEqual, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ target5 = DomainBase.u003cu003eo__19.u003cu003ep__21.Target(DomainBase.u003cu003eo__19.u003cu003ep__21, fieldInformation.Value, null);
+ if (DomainBase.u003cu003eo__19.u003cu003ep__25 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__25 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__25.Target(DomainBase.u003cu003eo__19.u003cu003ep__25, target5))
+ {
+ obj2 = target5;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__24 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__24 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 target7 = DomainBase.u003cu003eo__19.u003cu003ep__24.Target;
+ CallSite<Func<CallSite, object, object, object>> u003cu003ep_24 = DomainBase.u003cu003eo__19.u003cu003ep__24;
+ object obj6 = target5;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__23 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__23 = CallSite<Func<CallSite, object, string, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.Equal, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) })));
+ }
+ !0 _u002107 = DomainBase.u003cu003eo__19.u003cu003ep__23.Target;
+ CallSite<Func<CallSite, object, string, object>> u003cu003ep_23 = DomainBase.u003cu003eo__19.u003cu003ep__23;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__22 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__22 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ obj2 = target7(u003cu003ep_24, obj6, _u002107(u003cu003ep_23, DomainBase.u003cu003eo__19.u003cu003ep__22.Target(DomainBase.u003cu003eo__19.u003cu003ep__22, fieldInformation.Value), x.ValorAtual));
+ }
+ value = obj2;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__27 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__27 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsFalse, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__19.u003cu003ep__27.Target(DomainBase.u003cu003eo__19.u003cu003ep__27, value))
+ {
+ target3 = value;
+ }
+ else
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__26 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__26 = CallSite<Func<CallSite, object, bool, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.BinaryOperationLogical, ExpressionType.And, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType, null) })));
+ }
+ target3 = DomainBase.u003cu003eo__19.u003cu003ep__26.Target(DomainBase.u003cu003eo__19.u003cu003ep__26, value, !flag);
+ }
+ if (_u002106(u003cu003ep_28, target3))
+ {
+ return;
+ }
+ List<Diferenca> diferencas1 = diferencas2;
+ value = fieldInformation.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__29 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__29 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "GetType", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ obj3 = DomainBase.u003cu003eo__19.u003cu003ep__29.Target(DomainBase.u003cu003eo__19.u003cu003ep__29, value);
+ }
+ else
+ {
+ obj3 = null;
+ }
+ if (obj3 is DateTime)
+ {
+ diferenca = new Diferenca()
+ {
+ Campo = x.Campo,
+ Descricao = x.Descricao,
+ ValorAnterior = x.ValorAtual
+ };
+ Diferenca diferenca3 = diferenca;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__31 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__31 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 target8 = DomainBase.u003cu003eo__19.u003cu003ep__31.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_31 = DomainBase.u003cu003eo__19.u003cu003ep__31;
+ value = fieldInformation.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__30 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__30 = CallSite<Func<CallSite, object, string, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ target4 = DomainBase.u003cu003eo__19.u003cu003ep__30.Target(DomainBase.u003cu003eo__19.u003cu003ep__30, value, "G");
+ }
+ else
+ {
+ target4 = null;
+ }
+ diferenca3.ValorAtual = target8(u003cu003ep_31, target4);
+ diferenca1 = diferenca;
+ }
+ else
+ {
+ diferenca = new Diferenca()
+ {
+ Campo = x.Campo,
+ Descricao = x.Descricao
+ };
+ Diferenca diferenca4 = diferenca;
+ string valorAtual = x.ValorAtual;
+ if (valorAtual != null)
+ {
+ str = valorAtual.ToString();
+ }
+ else
+ {
+ str = null;
+ }
+ diferenca4.ValorAnterior = str;
+ Diferenca diferenca5 = diferenca;
+ if (DomainBase.u003cu003eo__19.u003cu003ep__33 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__33 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 _u002108 = DomainBase.u003cu003eo__19.u003cu003ep__33.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_33 = DomainBase.u003cu003eo__19.u003cu003ep__33;
+ value = fieldInformation.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__19.u003cu003ep__32 == null)
+ {
+ DomainBase.u003cu003eo__19.u003cu003ep__32 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ obj4 = DomainBase.u003cu003eo__19.u003cu003ep__32.Target(DomainBase.u003cu003eo__19.u003cu003ep__32, value);
+ }
+ else
+ {
+ obj4 = null;
+ }
+ diferenca5.ValorAtual = _u002108(u003cu003ep_33, obj4);
+ diferenca1 = diferenca;
+ }
+ diferencas1.Add(diferenca1);
+ });
+ return diferencas2;
+ }
+
+ public static void Copy<TU, T>(TU dest, T source)
+ {
+ List<PropertyInfo> list = (
+ from in (IEnumerable<PropertyInfo>)typeof(T).GetProperties()
+ where x.CanRead
+ select ).ToList<PropertyInfo>();
+ List<PropertyInfo> propertyInfos = (
+ from in (IEnumerable<PropertyInfo>)typeof(TU).GetProperties()
+ where x.CanWrite
+ select ).ToList<PropertyInfo>();
+ foreach (PropertyInfo propertyInfo in list)
+ {
+ if (!propertyInfos.Any<PropertyInfo>((PropertyInfo x) => x.Name == propertyInfo.Name))
+ {
+ continue;
+ }
+ propertyInfos.First<PropertyInfo>((PropertyInfo x) => x.Name == propertyInfo.Name).SetValue(dest, propertyInfo.GetValue(source, null), null);
+ }
+ }
+
+ private bool GetDefaultAttribute(PropertyInfo info)
+ {
+ return info.GetCustomAttributes(typeof(NameAttribute), true).Length != 0;
+ }
+
+ private string GetDescriptionAttribute(PropertyInfo info)
+ {
+ if (info == null)
+ {
+ return "";
+ }
+ object[] customAttributes = info.GetCustomAttributes(typeof(DescriptionAttribute), true);
+ if (customAttributes.Length == 0)
+ {
+ return info.Name.ToUpper();
+ }
+ return ((DescriptionAttribute)customAttributes[0]).Description;
+ }
+
+ private bool? GetLogAttribute(PropertyInfo info)
+ {
+ object[] customAttributes = info.GetCustomAttributes(typeof(LogAttribute), true);
+ if (customAttributes.Length == 0)
+ {
+ return null;
+ }
+ return new bool?(((LogAttribute)customAttributes[0]).Description);
+ }
+
+ public List<FieldInformation> GetProperties(object obj)
+ {
+ return obj.GetType().GetProperties().Where<PropertyInfo>((PropertyInfo x) => {
+ if (this.HasValidate(x.GetValue(obj)))
+ {
+ return false;
+ }
+ return this.GetLogAttribute(x).GetValueOrDefault();
+ }).Select<PropertyInfo, FieldInformation>((PropertyInfo key) => new FieldInformation()
+ {
+ Name = key.Name,
+ Description = this.GetDescriptionAttribute(key),
+ Value = key.GetValue(obj)
+ }).ToList<FieldInformation>();
+ }
+
+ public List<FieldInformation> GetProperties()
+ {
+ List<FieldInformation> fieldInformations = new List<FieldInformation>();
+ this.GetType().GetProperties().ToList<PropertyInfo>().ForEach((PropertyInfo x) => {
+ if (x.Name == "ValidationEvent")
+ {
+ return;
+ }
+ bool? logAttribute = this.GetLogAttribute(x);
+ if (logAttribute.HasValue)
+ {
+ bool? nullable = logAttribute;
+ if (!nullable.GetValueOrDefault() & nullable.HasValue)
+ {
+ return;
+ }
+ }
+ object value = x.GetValue(this);
+ if (this.HasValidate(value))
+ {
+ fieldInformations.AddRange(this.GetPropertiesChield(value, this.GetDescriptionAttribute(x), logAttribute, true));
+ }
+ else
+ {
+ FieldInformation property = this.GetProperty(x, value, logAttribute, null);
+ if (property != null)
+ {
+ fieldInformations.Add(property);
+ return;
+ }
+ }
+ });
+ return fieldInformations;
+ }
+
+ private List<FieldInformation> GetPropertiesChield(dynamic obj, string description, bool? log, bool defaultInfo = false)
+ {
+ List<FieldInformation> fieldInformations = new List<FieldInformation>();
+ if (obj == (dynamic)null)
+ {
+ return fieldInformations;
+ }
+ foreach (dynamic obj1 in (IEnumerable)obj.GetType().GetProperties())
+ {
+ if (obj1.Name == "ValidationEvent")
+ {
+ continue;
+ }
+ if ((!defaultInfo ? defaultInfo : defaultInfo & (dynamic)(!this.GetDefaultAttribute(obj1))))
+ {
+ continue;
+ }
+ log = (bool?)this.GetLogAttribute(obj1);
+ if (log.HasValue)
+ {
+ bool? nullable = log;
+ if (!nullable.GetValueOrDefault() & nullable.HasValue)
+ {
+ continue;
+ }
+ }
+ dynamic obj2 = obj1.GetValue(obj);
+ dynamic obj3 = obj2 != (dynamic)null;
+ if ((!obj3 ? obj3 == null : (obj3 & this.HasValidate(obj2)) == 0))
+ {
+ dynamic obj4 = this.GetProperty(obj1, obj2, log, description);
+ if (obj4 == (dynamic)null)
+ {
+ continue;
+ }
+ fieldInformations.Add(obj4);
+ }
+ else
+ {
+ fieldInformations.AddRange(this.GetPropertiesChield(obj2, this.GetDescriptionAttribute(obj1), log, true));
+ }
+ }
+ return fieldInformations;
+ }
+
+ public FieldInformation GetProperty(PropertyInfo property, dynamic value, bool? log, string description = null)
+ {
+ if (log.HasValue)
+ {
+ bool? nullable = log;
+ if (!(!nullable.GetValueOrDefault() & nullable.HasValue))
+ {
+ return new FieldInformation()
+ {
+ Name = property.Name,
+ Description = description ?? this.GetDescriptionAttribute(property),
+ Value = value
+ };
+ }
+ }
+ return null;
+ }
+
+ public List<ValorOriginal> GetValorOriginal()
+ {
+ return this.GetProperties().Select<FieldInformation, ValorOriginal>((FieldInformation x) => {
+ object value;
+ object target;
+ ValorOriginal valorOriginal = new ValorOriginal()
+ {
+ Campo = x.Name,
+ Descricao = x.Description
+ };
+ ValorOriginal valorOriginal1 = valorOriginal;
+ if (DomainBase.u003cu003eo__17.u003cu003ep__5 == null)
+ {
+ DomainBase.u003cu003eo__17.u003cu003ep__5 = CallSite<Func<CallSite, object, string>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.Convert(CSharpBinderFlags.None, typeof(string), typeof(DomainBase)));
+ }
+ !0 _u00210 = DomainBase.u003cu003eo__17.u003cu003ep__5.Target;
+ CallSite<Func<CallSite, object, string>> u003cu003ep_5 = DomainBase.u003cu003eo__17.u003cu003ep__5;
+ if (DomainBase.u003cu003eo__17.u003cu003ep__1 == null)
+ {
+ DomainBase.u003cu003eo__17.u003cu003ep__1 = CallSite<Func<CallSite, object, bool>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.UnaryOperation(CSharpBinderFlags.None, ExpressionType.IsTrue, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ !0 target1 = DomainBase.u003cu003eo__17.u003cu003ep__1.Target;
+ CallSite<Func<CallSite, object, bool>> u003cu003ep_1 = DomainBase.u003cu003eo__17.u003cu003ep__1;
+ if (DomainBase.u003cu003eo__17.u003cu003ep__0 == null)
+ {
+ DomainBase.u003cu003eo__17.u003cu003ep__0 = CallSite<Func<CallSite, object, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.BinaryOperation(CSharpBinderFlags.None, ExpressionType.NotEqual, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ if (target1(u003cu003ep_1, DomainBase.u003cu003eo__17.u003cu003ep__0.Target(DomainBase.u003cu003eo__17.u003cu003ep__0, x.Value, null)))
+ {
+ if (DomainBase.u003cu003eo__17.u003cu003ep__2 == null)
+ {
+ DomainBase.u003cu003eo__17.u003cu003ep__2 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "GetType", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ if (DomainBase.u003cu003eo__17.u003cu003ep__2.Target(DomainBase.u003cu003eo__17.u003cu003ep__2, x.Value) is DateTime)
+ {
+ value = x.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__17.u003cu003ep__3 == null)
+ {
+ DomainBase.u003cu003eo__17.u003cu003ep__3 = CallSite<Func<CallSite, object, string, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null), CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.UseCompileTimeType | CSharpArgumentInfoFlags.Constant, null) })));
+ }
+ target = DomainBase.u003cu003eo__17.u003cu003ep__3.Target(DomainBase.u003cu003eo__17.u003cu003ep__3, value, "G");
+ }
+ else
+ {
+ target = null;
+ }
+ }
+ else
+ {
+ value = x.Value;
+ if (value != null)
+ {
+ if (DomainBase.u003cu003eo__17.u003cu003ep__4 == null)
+ {
+ DomainBase.u003cu003eo__17.u003cu003ep__4 = CallSite<Func<CallSite, object, object>>.Create(Microsoft.CSharp.RuntimeBinder.Binder.InvokeMember(CSharpBinderFlags.None, "ToString", null, typeof(DomainBase), (IEnumerable<CSharpArgumentInfo>)(new CSharpArgumentInfo[] { CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) })));
+ }
+ target = DomainBase.u003cu003eo__17.u003cu003ep__4.Target(DomainBase.u003cu003eo__17.u003cu003ep__4, value);
+ }
+ else
+ {
+ target = null;
+ }
+ }
+ }
+ else
+ {
+ target = null;
+ }
+ valorOriginal1.ValorAtual = _u00210(u003cu003ep_5, target);
+ return valorOriginal;
+ }).ToList<ValorOriginal>();
+ }
+
+ public bool HasChange()
+ {
+ List<FieldInformation> properties = this.GetProperties();
+ List<FieldInformation> fieldInformations = this._originalValues;
+ return !properties.All<FieldInformation>(new Func<FieldInformation, bool>(fieldInformations.Contains));
+ }
+
+ public bool HasChange(string property)
+ {
+ IEnumerable<FieldInformation> name =
+ from x in this._originalValues
+ where x.Name == property
+ select x;
+ return !this.GetProperties().All<FieldInformation>(new Func<FieldInformation, bool>(name.Contains<FieldInformation>));
+ }
+
+ public bool HasProperty(object objectToCheck, string propertyName)
+ {
+ if (objectToCheck == null)
+ {
+ return false;
+ }
+ return objectToCheck.GetType().GetProperty(propertyName) != null;
+ }
+
+ public bool HasValidate(object objectToCheck)
+ {
+ if (objectToCheck == null)
+ {
+ return false;
+ }
+ return objectToCheck.GetType().GetProperty("ValidationEvent") != null;
+ }
+
+ public void Initialize()
+ {
+ this._originalValues = this.GetProperties();
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Generic/EmailBase.cs b/Gestor.Model/Model.Domain.Generic/EmailBase.cs new file mode 100644 index 0000000..96eccc8 --- /dev/null +++ b/Gestor.Model/Model.Domain.Generic/EmailBase.cs @@ -0,0 +1,32 @@ +using Gestor.Model.Attributes;
+using System;
+
+namespace Gestor.Model.Domain.Generic
+{
+ public class EmailBase : DomainBase
+ {
+ private string _email;
+
+ [Log(true)]
+ public string Email
+ {
+ get
+ {
+ string str = this._email;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToLower().Trim();
+ }
+ set
+ {
+ this._email = value;
+ }
+ }
+
+ public EmailBase()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Generic/EnderecoBase.cs b/Gestor.Model/Model.Domain.Generic/EnderecoBase.cs new file mode 100644 index 0000000..964fb70 --- /dev/null +++ b/Gestor.Model/Model.Domain.Generic/EnderecoBase.cs @@ -0,0 +1,128 @@ +using Gestor.Model.Attributes;
+using System;
+using System.ComponentModel;
+using System.Runtime.CompilerServices;
+using System.Text.RegularExpressions;
+
+namespace Gestor.Model.Domain.Generic
+{
+ public class EnderecoBase : DomainBase
+ {
+ private string _cep;
+
+ private string _endereco;
+
+ private string _numero;
+
+ private string _bairro;
+
+ private string _cidade;
+
+ private string _estado;
+
+ [Log(true)]
+ public string Bairro
+ {
+ get
+ {
+ return this._bairro;
+ }
+ set
+ {
+ this._bairro = value;
+ }
+ }
+
+ [Log(true)]
+ public string Cep
+ {
+ get
+ {
+ if (this._cep == null || !Regex.IsMatch(this._cep, "[0-9]+"))
+ {
+ return "";
+ }
+ return this._cep.Trim();
+ }
+ set
+ {
+ this._cep = value;
+ }
+ }
+
+ [Log(true)]
+ public string Cidade
+ {
+ get
+ {
+ return this._cidade;
+ }
+ set
+ {
+ this._cidade = value;
+ }
+ }
+
+ [Log(true)]
+ public string Complemento
+ {
+ get;
+ set;
+ }
+
+ [Description("ENDEREÇO")]
+ [Log(true)]
+ public string Endereco
+ {
+ get
+ {
+ return this._endereco;
+ }
+ set
+ {
+ this._endereco = value;
+ }
+ }
+
+ [Log(true)]
+ public string Estado
+ {
+ get
+ {
+ string str = this._estado;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._estado = value;
+ }
+ }
+
+ [Description("NÚMERO")]
+ [Log(true)]
+ public string Numero
+ {
+ get
+ {
+ string str = this._numero;
+ if (str != null)
+ {
+ return str.ToUpper();
+ }
+ return null;
+ }
+ set
+ {
+ this._numero = value;
+ }
+ }
+
+ public EnderecoBase()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Generic/FieldInformation.cs b/Gestor.Model/Model.Domain.Generic/FieldInformation.cs new file mode 100644 index 0000000..de124b5 --- /dev/null +++ b/Gestor.Model/Model.Domain.Generic/FieldInformation.cs @@ -0,0 +1,30 @@ +using System;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Generic
+{
+ public class FieldInformation
+ {
+ public string Description
+ {
+ get;
+ set;
+ }
+
+ public string Name
+ {
+ get;
+ set;
+ }
+
+ public dynamic Value
+ {
+ get;
+ set;
+ }
+
+ public FieldInformation()
+ {
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Generic/IDomain.cs b/Gestor.Model/Model.Domain.Generic/IDomain.cs new file mode 100644 index 0000000..c6a2ca0 --- /dev/null +++ b/Gestor.Model/Model.Domain.Generic/IDomain.cs @@ -0,0 +1,15 @@ +using System;
+using System.Collections.Generic;
+
+namespace Gestor.Model.Domain.Generic
+{
+ public interface IDomain
+ {
+ Func<List<KeyValuePair<string, string>>> ValidationEvent
+ {
+ get;
+ }
+
+ List<KeyValuePair<string, string>> Validate();
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Generic/TelefoneBase.cs b/Gestor.Model/Model.Domain.Generic/TelefoneBase.cs new file mode 100644 index 0000000..23f0cbe --- /dev/null +++ b/Gestor.Model/Model.Domain.Generic/TelefoneBase.cs @@ -0,0 +1,82 @@ +using Gestor.Model.Attributes;
+using Gestor.Model.Common;
+using Gestor.Model.Helper;
+using Gestor.Model.Resources;
+using System;
+using System.Collections.Generic;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Generic
+{
+ public class TelefoneBase : DomainBase
+ {
+ private string _numero;
+
+ private string _prefixo;
+
+ [Log(true)]
+ public string Numero
+ {
+ get
+ {
+ string str = this._numero;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._numero = value;
+ }
+ }
+
+ [Log(true)]
+ public string Prefixo
+ {
+ get
+ {
+ string str = this._prefixo;
+ if (str == null)
+ {
+ return null;
+ }
+ return str.ToUpper().Trim();
+ }
+ set
+ {
+ this._prefixo = value;
+ }
+ }
+
+ [Log(true)]
+ public TipoTelefone? Tipo
+ {
+ get;
+ set;
+ }
+
+ public TelefoneBase()
+ {
+ }
+
+ public List<KeyValuePair<string, string>> ValidateBase(bool obrigatorio = true)
+ {
+ List<KeyValuePair<string, string>> keyValuePairs = ValidationHelper.AddValue();
+ if (!this.Tipo.HasValue || this.Tipo.GetValueOrDefault() == TipoTelefone.Gratuita || this.Tipo.GetValueOrDefault() == TipoTelefone.Internacional || this.Tipo.GetValueOrDefault() == TipoTelefone.Outros || this.Tipo.GetValueOrDefault() == TipoTelefone.Whatsapp || this.Tipo.GetValueOrDefault() == TipoTelefone.TarifaUnica || this.Tipo.GetValueOrDefault() == TipoTelefone.Comercial)
+ {
+ return keyValuePairs;
+ }
+ if (!string.IsNullOrWhiteSpace(this.Prefixo) && !this.Prefixo.ValidacaoPrefixo())
+ {
+ keyValuePairs.AddValue<string, string>("Prefixo|DDD", Messages.Invalido, true);
+ }
+ if (!string.IsNullOrWhiteSpace(this.Numero) && !this.Numero.ValidacaoTelefone())
+ {
+ keyValuePairs.AddValue<string, string>("Numero|TELEFONE", Messages.Invalido, true);
+ }
+ return keyValuePairs;
+ }
+ }
+}
\ No newline at end of file diff --git a/Gestor.Model/Model.Domain.Generic/ValorOriginal.cs b/Gestor.Model/Model.Domain.Generic/ValorOriginal.cs new file mode 100644 index 0000000..7e2dbb3 --- /dev/null +++ b/Gestor.Model/Model.Domain.Generic/ValorOriginal.cs @@ -0,0 +1,30 @@ +using System;
+using System.Runtime.CompilerServices;
+
+namespace Gestor.Model.Domain.Generic
+{
+ public class ValorOriginal
+ {
+ public string Campo
+ {
+ get;
+ set;
+ }
+
+ public string Descricao
+ {
+ get;
+ set;
+ }
+
+ public string ValorAtual
+ {
+ get;
+ set;
+ }
+
+ public ValorOriginal()
+ {
+ }
+ }
+}
\ No newline at end of file |