Ejemplo n.º 1
0
        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...");
        }
Ejemplo n.º 2
0
 public ResolvedKey(AbstractKey grainKey, Type concreteType)
     : this(grainKey.AbstractType, concreteType, grainKey.Id)
 {
 }