private ProxyProvidedConstructorInfo(RdProvidedConstructorInfo constructorInfo, int typeProviderId, TypeProvidersContext typeProvidersContext, ProvidedTypeContextHolder context) : base(null, context.Context) { myConstructorInfo = constructorInfo; myTypeProviderId = typeProviderId; myTypeProvidersContext = typeProvidersContext; myContext = context; myParameters = new InterruptibleLazy <ProvidedParameterInfo[]>(() => // ReSharper disable once CoVariantArrayConversion myTypeProvidersContext.Connection .ExecuteWithCatch(() => RdProvidedConstructorInfoProcessModel.GetParameters.Sync(EntityId)) .Select(t => ProxyProvidedParameterInfo.Create(t, myTypeProviderId, typeProvidersContext, myContext)) .ToArray()); myGenericArguments = new InterruptibleLazy <ProvidedType[]>(() => myTypeProvidersContext.ProvidedTypesCache.GetOrCreateBatch(constructorInfo.GenericArguments, myTypeProviderId, myContext)); myStaticParameters = new InterruptibleLazy <ProvidedParameterInfo[]>(() => // ReSharper disable once CoVariantArrayConversion myTypeProvidersContext.Connection .ExecuteWithCatch(() => RdProvidedConstructorInfoProcessModel.GetStaticParametersForMethod.Sync(EntityId)) .Select(t => ProxyProvidedParameterInfo.Create(t, myTypeProviderId, typeProvidersContext, myContext)) .ToArray()); myCustomAttributes = new InterruptibleLazy <RdCustomAttributeData[]>(() => myTypeProvidersContext.ProvidedCustomAttributeProvider.GetCustomAttributes(this)); }
public static ProxyProvidedConstructorInfo Create(RdProvidedConstructorInfo constructorInfo, int typeProviderId, TypeProvidersContext typeProvidersContext, ProvidedTypeContextHolder context) => constructorInfo == null ? null : new ProxyProvidedConstructorInfo(constructorInfo, typeProviderId, typeProvidersContext, context);