Wednesday, February 19, 2014

Enable Proxy Types in Plugins

If you need to use Linq Queries in plugins/workflows, you have to enable proxy types before instantiating the service object from service provider.


factory.GetType().GetProperty("ProxyTypesAssembly").SetValue(factory,typeof(YourCrmContext).Assembly, null);