OrleansContrib / OrleansTestKit

Unit Test Toolkit for Microsoft Orleans
http://dotnet.github.io/orleans
MIT License
78 stars 43 forks source link

How do we create new POCO grains? #127

Closed michaelmcneilnet closed 9 months ago

michaelmcneilnet commented 1 year ago

v4.0.0-beta1

I am trying to create a new grain with the following code

var grain = await Silo.CreateGrainAsync<MyGrain>("a");

but it seems the generic for CreateGrainAsync is constrained to type of Grain.

From src/OrleansTestKit/TestKitSilo:

 public Task<T> CreateGrainAsync<T>(string id) where T : Grain, IGrainWithStringKey =>
        CreateGrainAsync<T>(IdSpan.Create(id));

Is there a way to create grains that are not based on Grain? My grain implements IGrainBase instead.

seniorquico commented 9 months ago

@michaelmcneilnet v4.0.0 has been released to GitHub and NuGet that includes support for POCO grains thanks to spingee in #130.