/// <summary>
        /// 要通过数据判断值对象相等
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            var target = obj as ValueObject;

            if (target == null)
            {
                return(false);
            }

            var targetType = target.ObjectType;

            if (targetType != ObjectType)
            {
                return(false);
            }

            //对比所有领域属性
            var properties = DomainProperty.GetProperties(ObjectType);

            foreach (var property in properties)
            {
                if (!EqualsHelper.ObjectEquals(this.GetValue(property), target.GetValue(property)))
                {
                    return(false);
                }
            }
            return(true);
        }
Beispiel #2
0
 public override bool Equals(object obj)
 {
     if (obj is MethodParameter)
     {
         var target = (MethodParameter)obj;
         return(EqualsHelper.ObjectEquals(this.Type, target.Type) &&
                this.IsGeneric == target.IsGeneric);
     }
     return(false);
 }
Beispiel #3
0
 public override bool Equals(object obj)
 {
     if (obj is ConstructorKey)
     {
         var target = (ConstructorKey)obj;
         return(EqualsHelper.ObjectEquals(this.ObjectType, target.ObjectType) &&
                this.IsGenericVersion == target.IsGenericVersion &&
                EqualsHelper.ListEquals(this.Parameters, target.Parameters) &&
                EqualsHelper.ListEquals(this.GenericTypes, target.GenericTypes));
     }
     return(false);
 }