Ejemplo n.º 1
0
        public static string GetRightExpression(EDataBaseType dataType, EValueType valueType, string value, List <string> parameters, bool isarray)
        {
            switch (valueType)
            {
            case EValueType.Const:
                return(DataTypeMetadata.GenerateValueExpression(dataType, value, false));

            case EValueType.Parameter:
                parameters.Add(value);
                return(value);

            case EValueType.Property:
                return("item." + value);
            }
            throw UtilityException.NotSupported("不支持查询值类型");
        }
Ejemplo n.º 2
0
        public override void Initialize(ProjectMetadata project)
        {
            base.Initialize(project);
            var common = Member.Content as CommonDataType;

            if (common != null && common.BaseType == EDataBaseType.Timestamp &&
                Entity.DataContext.DatabaseType == EDatabaseType.MySql)
            {
                PropertyType = new DataTypeMetadata(new DateTimeType(), Project, true);
            }
            else
            {
                PropertyType = new DataTypeMetadata(Member.Content, Project, this.IsRequired);
            }

            if (common != null)
            {
                Validator(common);
            }
        }