Beispiel #1
0
        public static void GetShardKeyType(PropertyInfo prop, Type propType, ParameterMapAttributeBase attrPM, MemberExpression childProperty)
        {
            var tDataId = propType.GetGenericArguments()[1];

            if (!attrPM.IsValidType(tDataId))
            {
                throw new InvalidMapTypeException(prop, attrPM.SqlType, attrPM.SqlTypeName);
            }
        }
Beispiel #2
0
        //public MapShardKeyAttribute(char origin, string recordIdName)
        //{
        //    this.Origin = origin;
        //    this.ShardIdName = null;
        //    this.RecordIdName = recordIdName;
        //    this.ChildIdName = null;
        //    this.GrandChildIdName = null;
        //    this.GreatGrandChildIdName = null;
        //}

        //public MapShardKeyAttribute(string shardIdName, char origin, string recordIdName)
        //{
        //    this.Origin = origin;
        //    this.ShardIdName = shardIdName;
        //    this.RecordIdName = recordIdName;
        //    this.ChildIdName = null;
        //    this.GrandChildIdName = null;
        //    this.GreatGrandChildIdName = null;
        //}

        //public MapShardKeyAttribute(char origin, string recordIdName, string childIdName)
        //{
        //    this.Origin = origin;
        //    this.ShardIdName = null;
        //    this.RecordIdName = recordIdName;
        //    this.ChildIdName = childIdName;
        //    this.GrandChildIdName = null;
        //    this.GreatGrandChildIdName = null;
        //}

        //public MapShardKeyAttribute(string shardIdName, char origin, string recordIdName, string childIdName)
        //{
        //    this.Origin = origin;
        //    this.ShardIdName = shardIdName;
        //    this.RecordIdName = recordIdName;
        //    this.ChildIdName = childIdName;
        //    this.GrandChildIdName = null;
        //    this.GreatGrandChildIdName = null;
        //}

        //public MapShardKeyAttribute(char origin, string recordIdName, string childIdName, string grandChildIdName)
        //{
        //    this.Origin = origin;
        //    this.ShardIdName = null;
        //    this.RecordIdName = recordIdName;
        //    this.ChildIdName = childIdName;
        //    this.GrandChildIdName = null;
        //    this.GreatGrandChildIdName = null;
        //}

        //public MapShardKeyAttribute(string shardIdName, char origin, string recordIdName, string childIdName, string grandChildIdName)
        //{
        //    this.Origin = origin;
        //    this.ShardIdName = shardIdName;
        //    this.RecordIdName = recordIdName;
        //    this.ChildIdName = childIdName;
        //    this.GrandChildIdName = grandChildIdName;
        //    this.GreatGrandChildIdName = grandChildIdName;
        //}

        //public MapShardKeyAttribute(char origin, string recordIdName, string childIdName, string grandChildIdName, string greatGrandChildIdName)
        //{
        //    this.Origin = origin;
        //    this.ShardIdName = null;
        //    this.RecordIdName = recordIdName;
        //    this.ChildIdName = childIdName;
        //    this.GrandChildIdName = grandChildIdName;
        //    this.GreatGrandChildIdName = greatGrandChildIdName;
        //}

        public MapShardKeyAttribute(ParameterMapAttributeBase shardId, char origin, string recordIdName, string childIdName, string grandChildIdName, string greatGrandChildIdName)
        {
            this.Origin = origin;

            _shardId                   = shardId;
            this.RecordIdName          = recordIdName;
            this.ChildIdName           = childIdName;
            this.GrandChildIdName      = grandChildIdName;
            this.GreatGrandChildIdName = greatGrandChildIdName;
        }