Пример #1
0
        public static PrimitiveDataDefine CreateString(bool isNullable, int fieldOrder)
        {
            PrimitiveDataDefine mapping = CreateFromStringType(isNullable);

            mapping.FieldOrder = fieldOrder;
            return(mapping);
        }
Пример #2
0
        public static PrimitiveDataDefine CreateString(bool isNullable, string fieldName)
        {
            PrimitiveDataDefine mapping = CreateFromStringType(isNullable);

            mapping.FieldName = fieldName;
            return(mapping);
        }
Пример #3
0
        public static PrimitiveDataDefine Create(Type type, int fieldOrder)
        {
            PrimitiveDataDefine mapping = CreateType(type);

            mapping.FieldOrder = fieldOrder;
            return(mapping);
        }
Пример #4
0
        public static PrimitiveDataDefine Create(Type type, string fieldName)
        {
            PrimitiveDataDefine mapping = CreateType(type);

            mapping.FieldName = fieldName;
            return(mapping);
        }
Пример #5
0
        private static PrimitiveDataDefine CreateFromStringType(bool isNullable)
        {
            PrimitiveDataDefine mapping = null;

            mapping            = new PrimitiveDataDefine(typeof(string));
            mapping.IsNullable = isNullable;
            return(mapping);
        }
Пример #6
0
        private static PrimitiveDataDefine CreateType(Type type)
        {
            PrimitiveDataDefine mapping = null;
            bool isnullable;

            if (DefineList.TryGetValue(type, out isnullable))
            {
                mapping            = new PrimitiveDataDefine(type);
                mapping.IsNullable = isnullable;
                return(mapping);
            }
            if (type == typeof(string))
            {
                mapping = new PrimitiveDataDefine(typeof(string));
            }
            else
            {
                throw new LightDataException(RE.SingleFieldSelectTypeError);
            }
            return(mapping);
        }