コード例 #1
0
        public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
        {
            var info = (UserRequiredPropertyInfo)conceptInfo;

            if (UserRequiredPropertyCodeGenerator.IsSupported(info.Property) &&
                (info.Property is ShortStringPropertyInfo || info.Property is LongStringPropertyInfo))
            {
                codeBuilder.InsertCode("|| string.IsNullOrWhiteSpace(item." + info.Property.Name + ") ", UserRequiredPropertyCodeGenerator.OrCondition, info);
            }
        }
コード例 #2
0
        public void GenerateCode(IConceptInfo conceptInfo, ICodeBuilder codeBuilder)
        {
            var info = (UserRequiredPropertyInfo)conceptInfo;

            if (UserRequiredPropertyCodeGenerator.IsSupported(info.Property) &&
                (info.Property is ShortStringPropertyInfo || info.Property is LongStringPropertyInfo))
            {
                codeBuilder.InsertCode(CheckDataSnippet(info), WritableOrmDataStructureCodeGenerator.ArgumentValidationTag, info.Property.DataStructure);
                codeBuilder.AddReferencesFromDependency(typeof(UserException));
            }
        }