كيف يمكنني تحديد typeAliases والكائنات في خارجي Spring.NET ملف التكوين
-
05-07-2019 - |
سؤال
حل!!!!شكرا على مساعدتك
أنا ضعت هنا أود أن إزالة جميع Spring.NET التكوين خارج شبكة الإنترنت.التكوين ولكن أنا غير قادر على معرفة كيفية وضع typeAliases.
سوف نقدر كل المساعدة التي يمكن أن تعطي لي.
شكرا
المحلول
يمكنك التسجيل نوع الأسماء المستعارة سواء في التطبيق.config/ويب.التكوين:
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
<section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHandler, Spring.Core"/>
</sectionGroup>
</configSections>
<spring>
<typeAliases>
<alias name="Prog" type="MyNs.Program, MyLibrary" />
</typeAliases>
<context>
<resource uri="context.xml"/>
</context>
</spring>
أو في الربيع ملف التكوين عن طريق إضافة تعريف Spring.Objects.Factory.Config.TypeAliasConfigurer
وجوه:
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
<object id="program" type="Prog" />
<object id="myTypeAlias" type="Spring.Objects.Factory.Config.TypeAliasConfigurer, Spring.Core">
<property name="TypeAliases">
<dictionary>
<entry key="Prog" value="MyNs.Program, MyLibrary"/>
</dictionary>
</property>
</object>
</objects>
سوف تجد هذا في الوثائق.
لا تنتمي إلى StackOverflow