New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling this.GetPrimaryKey() from base class is failing #47
Comments
Thanks for the report, @keithazzopardi. Is it possible for you to create and share some example code that reproduces the issue? |
Digging into Orleans... I found the following ...
var grainBase = grain as Grain;
if (grainBase != null)
{
if (grainBase.Data == null || grainBase.Data.Identity == null)
{
throw new ArgumentException(WRONG_GRAIN_ERROR_MSG, "grain");
}
return grainBase.Data.Identity;
}
... The // Do not use this directly because we currently don't provide a way to inject it;
// any interaction with it will result in non unit-testable code. Any behaviour that can be accessed
// from within client code (including subclasses of this class), should be exposed through IGrainRuntime.
// The better solution is to refactor this interface and make it injectable through the constructor.
internal IActivationData Data; Check out dotnet/orleans#3086 and dotnet/orleans#3145. I think we may be stuck. Now, it doesn't look like all |
I have a grain which is inheriting from a GrainBase. In the GrainBase I have a method which is using this.GetPrimaryKey() to perform another operation. I'm having the following error on this.GetPrimaryKey() when running the tests only.
Message: System.ArgumentException : Passing a half baked grain as an argument. It is possible that you instantiated a grain class explicitly, as a regular object and not via Orleans runtime or via proper test mocking
Parameter name: grain
The text was updated successfully, but these errors were encountered: