src/Orleans.Core/Manifest/GrainPropertiesResolver.cs
/// <summary>
/// Gets the grain properties for the provided type.
/// </summary>
/// <param name="grainType">
/// The grain type.
/// </param>
/// <param name="properties">
/// The grain properties.
/// </param>
/// <returns>
/// A value indicating whether grain properties could be found for the provided grain type.
/// </returns>
Gets the grain properties for the provided type.
Gets the grain properties for the provided type .
public bool TryGetGrainProperties(GrainType grainType, [NotNullWhen(true)] out GrainProperties properties)
        {
            var clusterManifest = _clusterManifestProvider.Current;
            if (clusterManifest is null)
            {
                properties = default;
                return false;
            }
            GrainType lookupKey;
            if (GenericGrainType.TryParse(grainType, out var generic))
            {
                lookupKey = generic.GetUnconstructedGrainType().GrainType;
            }
            else
            {
                lookupKey = grainType;
            }
            foreach (var manifest in clusterManifest.AllGrainManifests)
            {
                if (manifest.Grains.TryGetValue(lookupKey, out properties))
                {
                    return true;
                }
            }
            properties = default;
            return false;
        }
public bool TryGetGrainProperties ( GrainType grainType , [ NotNullWhen ( true ) ] out GrainProperties properties ) { var clusterManifest = _clusterManifestProvider . Current ; if ( clusterManifest is null ) { properties = default ; return false ; } GrainType lookupKey ; if ( GenericGrainType . TryParse ( grainType , out var generic ) ) { lookupKey = generic . GetUnconstructedGrainType ( ) . GrainType ; } else { lookupKey = grainType ; } foreach ( var manifest in clusterManifest . AllGrainManifests ) { if ( manifest . Grains . TryGetValue ( lookupKey , out properties ) ) { return true ; } } properties = default ; return false ; }
Gets the grain properties for the provided type.
Gets the grain properties for the provided type .
A value indicating whether grain properties could be found for the provided grain type.
A value indicating whether grain properties could be found for the provided grain type .
grainType
GrainType
The grain type.
The grain type .
out
[NotNullWhen(true)]
properties
The grain properties.
The grain properties .