Пример #1
0
        public IOrmAttribute MergeChanges(IOrmAttribute otherAttribute, MergeConflictAction mergeConflictAction)
        {
            OrmHierarchyRootAttribute other        = (OrmHierarchyRootAttribute)otherAttribute;
            OrmHierarchyRootAttribute mergedResult = new OrmHierarchyRootAttribute();

            bool enabled = this.Enabled;

            //if (!other.Enabled && mergeConflictAction == MergeConflictAction.TakeOther)
            if (other.Enabled && !enabled && mergeConflictAction == MergeConflictAction.TakeOther)
            {
                enabled = other.Enabled;
            }

            mergedResult.Enabled = enabled;

            var mergedInheritanceSchema = this.GetDefInheritanceSchema().Merge(other.GetDefInheritanceSchema(),
                                                                               mergeConflictAction);

            mergedResult.InheritanceSchema = mergedInheritanceSchema.Value;

            mergedResult.IncludeTypeId = this.IncludeTypeId.Merge(other.IncludeTypeId, mergeConflictAction);
            mergedResult.MappingName   = this.MappingName.Merge(other.MappingName, mergeConflictAction);

            return(mergedResult);
        }
Пример #2
0
        protected override bool InternalEqualsTo(DefaultableMulti other)
        {
            OrmHierarchyRootAttribute otherAttr = (OrmHierarchyRootAttribute)other;

            return(this.IncludeTypeId.EqualsTo(otherAttr.IncludeTypeId) &&
                   this.InheritanceSchema == otherAttr.InheritanceSchema &&
                   this.MappingName.EqualsTo(otherAttr.MappingName));
        }
Пример #3
0
 protected override void InternalAssignFrom(DefaultableMulti other)
 {
     if (other is OrmHierarchyRootAttribute)
     {
         OrmHierarchyRootAttribute attr = (OrmHierarchyRootAttribute)other;
         this.Enabled           = attr.Enabled;
         this.IncludeTypeId     = (Defaultable <bool>)attr.IncludeTypeId.Clone();
         this.InheritanceSchema = attr.InheritanceSchema;
         this.MappingName       = (Defaultable <string>)attr.MappingName.Clone();
     }
 }