diff Implab.ServiceHost/Unity/TypeRegistrationBuilder.cs @ 278:6691aff01de1 v3

Implab: added XmlDefaultSeializer (SerializersPool is now obsolete) Implab.ServiceHost: rewritten TypeReference (added support for nested types), stable API
author cin
date Thu, 03 May 2018 09:59:44 +0300
parents 963b17c275be
children 8714471e8d78
line wrap: on
line diff
--- a/Implab.ServiceHost/Unity/TypeRegistrationBuilder.cs	Sat Apr 28 18:48:09 2018 +0300
+++ b/Implab.ServiceHost/Unity/TypeRegistrationBuilder.cs	Thu May 03 09:59:44 2018 +0300
@@ -37,7 +37,7 @@
 
             var parameters = constructorInjection.Parameters?
                 .Select(x => {
-                    var valueBuilder = new InjectionValueBuilder(m_resolver, null);
+                    var valueBuilder = new InjectionParameterBuilder(m_resolver, null);
                     x.Visit(valueBuilder);
                     return valueBuilder.Injection;
                 })
@@ -48,11 +48,9 @@
         }
 
         internal void Visit(MethodInjectionElement methodInjection) {
-            var valueContext = new InjectionValueBuilder(m_resolver, null);
-
             var parameters = methodInjection.Parameters?
                 .Select(x => {
-                    var valueBuilder = new InjectionValueBuilder(m_resolver, null);
+                    var valueBuilder = new InjectionParameterBuilder(m_resolver, null);
                     x.Visit(valueBuilder);
                     return valueBuilder.Injection;
                 })
@@ -66,8 +64,8 @@
             if (propertyInjection.Value == null)
                 throw new Exception($"A value value must be specified for the property '{propertyInjection.Name}'");
 
-            var propertyType = RegistrationType.GetProperty(propertyInjection.Name)?.PropertyType;
-            var valueContext = new InjectionValueBuilder(m_resolver, propertyType);
+            var propertyType = ImplementationType.GetProperty(propertyInjection.Name)?.PropertyType;
+            var valueContext = new InjectionParameterBuilder(m_resolver, propertyType);
 
             propertyInjection.Value.Visit(valueContext);
             var injection = new InjectionProperty(propertyInjection.Name, valueContext.Injection);