src/Orleans.Core/Core/GrainFactory.cs
/// <summary>
/// Creates an object reference which points to the provided object.
/// </summary>
/// <param name="interfaceType">The interface type which the reference must implement..</param>
/// <param name="obj">The addressable object implementation.</param>
/// <returns>An object reference.</returns>
Creates an object reference which points to the provided object.
Creates an object reference which points to the provided object .
private object CreateObjectReference(Type interfaceType, IAddressable obj)
        {
            if (!interfaceType.IsInterface)
            {
                throw new ArgumentException(
                    $"The provided type parameter must be an interface. '{interfaceType.FullName}' is not an interface.");
            }
            if (!interfaceType.IsInstanceOfType(obj))
            {
                throw new ArgumentException($"The provided object must implement '{interfaceType.FullName}'.", nameof(obj));
            }
            return this.Cast(this.runtimeClient.CreateObjectReference(obj), interfaceType);
        }
private object CreateObjectReference ( Type interfaceType , IAddressable obj ) { if ( ! interfaceType . IsInterface ) { throw new ArgumentException ( $" The provided type parameter must be an interface. ' { interfaceType . FullName } ' is not an interface. " ) ; } if ( ! interfaceType . IsInstanceOfType ( obj ) ) { throw new ArgumentException ( $" The provided object must implement ' { interfaceType . FullName } '. " , nameof ( obj ) ) ; } return this . Cast ( this . runtimeClient . CreateObjectReference ( obj ) , interfaceType ) ; }
Creates an object reference which points to the provided object.
Creates an object reference which points to the provided object .
An object reference.
An object reference .
interfaceType
Type
The interface type which the reference must implement
The interface type which the reference must implement
obj
IAddressable
The addressable object implementation.
The addressable object implementation .