Пример #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...");
        }
Пример #2
0
 public ResolvedKey(AbstractKey grainKey, Type concreteType)
     : this(grainKey.AbstractType, concreteType, grainKey.Id)
 {
 }