public static AbstractKey GetGrainKey(this IAddressable @this)
        {
            if (@this is GrainProxy)
            {
                return(((GrainProxy)@this).Key);
            }

            if (@this is Grain)
            {
                var keyString = ((Grain)@this).IdentityString;
                return(AbstractKey.Parse(keyString));
            }

            throw new InvalidOperationException("Can't extract GrainKey from such an IAddressable...");
        }
Esempio n. 2
0
 public ResolvedKey(AbstractKey grainKey, Type concreteType)
     : this(grainKey.AbstractType, concreteType, grainKey.Id)
 {
 }