/// <summary> /// Casts a grain to a specific grain interface. /// </summary> /// <typeparam name="TGrainInterface">The type of the grain interface.</typeparam> /// <param name="grain">The grain to cast.</param> public static TGrainInterface Cast <TGrainInterface>(this Runtime.IAddressable grain) { return(GrainFactory.Cast <TGrainInterface>(grain)); }
/// <summary> /// Converts this grain to a specific grain interface. /// </summary> /// <typeparam name="TGrainInterface">The type of the grain interface.</typeparam> /// <param name="grain">The grain to convert.</param> /// <returns>A strongly typed <c>GrainReference</c> of grain interface type TGrainInterface.</returns> public static TGrainInterface AsReference <TGrainInterface>(this Runtime.IAddressable grain) { return(GrainFactory.Cast <TGrainInterface>(grain.AsWeaklyTypedReference())); }