c# - Postsharp/Reflection Conflict -


I have 2 basic classes entity and EntityCollection and all of them In the data class underlying entity class constructor, I wanted to call this method:

  public static zero InitAllCollection (object o) {foreach (var propertyinfo in o.GetType). GetRuntimeProperties ()) {if (PropertyInfo.PropertyType.IS CONSTOCKED GENERIC TYPE [propertyInfo.PropertyType.GetGenericTypeDefinition ()! = TYPE (EntityCollection & lt; & gt;)); Var ctor = propertyInfo.PropertyType.GetTypeInfo (). DeclaredConstructors Where (C =>? C.GetParameters (). Any ()). Select (C = & gt; c) .FirstOrDefault (); PropertyInfo.SetValue (o, ctor.Invoke (new object [0])); }}  

This method was automatically a member of all the EntityCollection unit, so I do not need to duplicate the code.

And everything until I posted the NotifierPropertyChanged aspect to the quickest aspect of the posting that worked fine after that code propertyInfo.SetValue (o, ctor.Invoke ( New object [0])); truing is TargetInvocationException .

Can I tell in some way the EntityCollection to exclude the generic postsharp or to summon them at least before the constructor ends.

Edit: The InitAllCollection method is called unit in addition to the constructor it is a project for Windows 8.1


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -