English 中文(简体)
Micsoroft 企业校验框架 - > 每个经验证的类型如何有一个配置文件
原标题:Micsoroft Enterprise Validation framework -> How to have one config file per validated Type

我正在使用微软企业验证框架。 并且正在连接文件验证。 配置文件在我的 app. config 文件中 。

<section name="validation"    type="Microsoft.Practices.EnterpriseLibrary.Validation.Configuration.ValidationSettings, Microsoft.Practices.EnterpriseLibrary.Validation, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        allowLocation="true" allowDefinition="MachineToApplication" restartOnExternalChanges="false"  />

<validation configSource="LocalConfigurationvalidation.config" />

在验证中. config 文件 I have

<?xml version="1.0" encoding="utf-8" ?>
<validation>
    <type name="Car">
     <ruleset>
      <properties>
       <validators>...</validators>
      </properties>
     </ruleset>
    </type>
    <type name="Human">
     <ruleset>
      <properties>
       <validators>...</validators>
      </properties>
     </ruleset>
    </type>
</validation>

问题是:我可以把汽车和人类类型放入不同的文件, 并将这些文件连接到验证中。 配置或者有任何其他分离方式, 因为我的验证器太多, 我希望它干净易读。

问题回答




相关问题
Validation Application Block Questions

Has anyone used the validation application block from enterprise library? Any success? Anyways, my question is with regards to validating a numeric unique identifier. Lets say I have a Product ...

Enterpise Library 4.1

I m using enterprise library 4.1 and i wish to create different log files for different event types. eg. Error.log for Error events, Warning.log for Warning events, how can accomplish this ? thx

热门标签