It is similar to Java, use [InstanceResource] attribute:
class MyJob : IComputeJob<object>
{
[InstanceResource] private IIgnite _ignite;
public object Execute()
{
Console.WriteLine(_ignite.Name);
...
}
....
}
On Thu, May 4, 2017 at 4:19 PM, Humphrey <[email protected]> wrote:
> This question is related to .NET with C#.
>
> I have a class that implements IComputeJob, which prints out a line in the
> console.
> How can I inlcude the IgniteInstanceName in the Console.WriteLine method?
>
> I know in Java you can inject the Ignite instace in the method, but I don't
> know how I should do it in C#.
>
> In Java:
> @IgniteInstanceResource
> private Ignite ignite;
>
> I'm just upgraded everything to ignite 2.0.0 with NUGET.
>
> Humphrey
>
>
>
> --
> View this message in context: http://apache-ignite-users.
> 70518.x6.nabble.com/Resource-Injection-in-NET-tp12420.html
> Sent from the Apache Ignite Users mailing list archive at Nabble.com.
>