private void AddFactoryMethods(GrainInterfaceData si, CodeTypeDeclaration factoryClass) { RecordReferencedNamespaceAndAssembly(si.Type); if (GrainInterfaceData.IsGrainType(si.Type) && ShouldGenerateGetGrainMethods(si.Type)) { AddGetGrainMethods(si, factoryClass); } }
internal static IAddressable MakeGrainReference_FromType( Func <GrainClassData, GrainId> getGrainId, Type interfaceType, string grainClassNamePrefix = null) { CheckRuntimeEnvironmentSetup(); if (!GrainInterfaceData.IsGrainType(interfaceType)) { throw new ArgumentException("Cannot fabricate grain-reference for non-grain type: " + interfaceType.FullName); } var implementation = TypeCodeMapper.GetImplementation(interfaceType, grainClassNamePrefix); GrainId grainId = getGrainId(implementation); return(GrainReference.FromGrainId(grainId, interfaceType.IsGenericType ? interfaceType.UnderlyingSystemType.FullName : null)); }