private Type CreateEquivalentWrapperType( Type contractType, IDictionary <string, Type> extraCtorParams, ITypeCacher typeCacher, string wrapperMode) { var keyObject = $"{contractType.FullName}-{wrapperMode}-Wrapper"; if (typeCacher.ContainesKey(keyObject)) { return((Type)typeCacher.Get(keyObject)); } var wrapperType = TypeFactory.CreateImplementationServicePack( type: contractType, typePostfix: $"{wrapperMode}_Wrapper", interfaces: new[] { contractType, typeof(IDisposable) }, optimizationPackage: optimizationPackage, extraCtorParams: extraCtorParams) .MatchType; typeCacher.Hold(keyObject, wrapperType); return(wrapperType); }
private ServicePack CreateEquivalentConnectedType( Type contractType, ITypeCacher typeCacher, bool isTransactional) { var keyObject = $"{serviceType.FullName}-Connected:{isTransactional}"; if (typeCacher.ContainesKey(keyObject)) { return((ServicePack)typeCacher.Get(keyObject)); } var onTypeAttributes = WcfAttributeFactory.CreateOnTypeAttributes(isTransactional); var forAllmembersAttributes = WcfAttributeFactory.CreateForAllmembersConnectedAttributes(isTransactional); var forAllInvolvedTypesAttributes = WcfAttributeFactory.CreateForAllInvolvedTypesAttributes(); var forAllInvolvedTypeMembersAttributes = WcfAttributeFactory.CreateForAllInvolvedTypeMembersAttributes(); var servicePack = TypeFactory.CreateInterfaceServicePack( type: contractType, typePostfix: connectedPostFix, onType: onTypeAttributes, forAllmembers: forAllmembersAttributes, forAllInvolvedTypes: forAllInvolvedTypesAttributes, optimizationPackage: optimizationPackage, forAllInvolvedTypeMembers: forAllInvolvedTypeMembersAttributes); typeCacher.Hold(keyObject, servicePack); return(servicePack); }
private ServicePack CreateEquivalentDisconnectedType(Type contractType, ITypeCacher typeCacher) { var keyObject = $"{serviceType.FullName}-Disconnected"; if (typeCacher.ContainesKey(keyObject)) { return((ServicePack)typeCacher.Get(keyObject)); } var onTypeAttributes = WcfAttributeFactory.CreateOnTypeAttributes(); var forAllmembersAttributes = WcfAttributeFactory.CreateForAllmembersDisconnectedAttributes(); var forAllInvolvedTypesAttributes = WcfAttributeFactory.CreateForAllInvolvedTypesAttributes(); var forAllInvolvedTypeMembersAttributes = WcfAttributeFactory.CreateForAllInvolvedTypeMembersAttributes(); var servicePack = TypeFactory.CreateInterfaceServicePack( type: contractType, typePostfix: disconnectedPostFix, onType: onTypeAttributes, forAllmembers: forAllmembersAttributes, forAllInvolvedTypes: forAllInvolvedTypesAttributes, optimizationPackage: optimizationPackage, forAllInvolvedTypeMembers: forAllInvolvedTypeMembersAttributes, allMethodsVoid: true); typeCacher.Hold(keyObject, servicePack); return(servicePack); }