示例#1
0
        public DuplicatedField DuplicateField(string memberName)
        {
            var field     = FieldFor(memberName);
            var duplicate = new DuplicatedField(field.Members);

            _fields[memberName] = duplicate;

            return(duplicate);
        }
示例#2
0
        public DuplicatedField DuplicateField(string memberName, string pgType = null)
        {
            var field     = FieldFor(memberName);
            var duplicate = new DuplicatedField(_storeOptions.Serializer().EnumStorage, field.Members);

            if (pgType.IsNotEmpty())
            {
                duplicate.PgType = pgType;
            }

            setField(memberName, duplicate);

            return(duplicate);
        }
示例#3
0
        public DuplicatedField DuplicateField(string memberName, string pgType = null)
        {
            var field     = FieldFor(memberName);
            var duplicate = new DuplicatedField(field.Members);

            if (pgType.IsNotEmpty())
            {
                duplicate.PgType = pgType;
            }

            _fields[memberName] = duplicate;

            return(duplicate);
        }
示例#4
0
        public DuplicatedField DuplicateField(MemberInfo[] members, string pgType = null)
        {
            var memberName = members.Select(x => x.Name).Join("");

            var duplicatedField = new DuplicatedField(_storeOptions.Serializer().EnumStorage, members);

            if (pgType.IsNotEmpty())
            {
                duplicatedField.PgType = pgType;
            }

            _fields[memberName] = duplicatedField;

            return(duplicatedField);
        }
示例#5
0
        public IndexDefinition DuplicateField(MemberInfo[] members, string pgType = null)
        {
            var memberName = members.Select(x => x.Name).Join("");

            var duplicatedField = new DuplicatedField(members);

            if (pgType.IsNotEmpty())
            {
                duplicatedField.PgType = pgType;
            }

            _fields[memberName] = duplicatedField;

            return(AddIndex(duplicatedField.ColumnName));
        }
示例#6
0
        public static DuplicatedField For <T>(EnumStorage enumStorage, Expression <Func <T, object> > expression, bool useTimestampWithoutTimeZoneForDateTime = true, string pgType = null)
        {
            var accessor = ReflectionHelper.GetAccessor(expression);

            // Hokey, but it's just for testing for now.
            if (accessor is PropertyChain)
            {
                throw new NotSupportedException("Not yet supporting deep properties yet. Soon.");
            }

            var duplicate = new DuplicatedField(enumStorage, new MemberInfo[] { accessor.InnerProperty }, useTimestampWithoutTimeZoneForDateTime);

            if (pgType.IsNotEmpty())
            {
                duplicate.PgType = pgType;
            }
            return(duplicate);
        }