OrleansContrib / Orleans.Providers.MongoDB

A MongoDb implementation of the Orleans Providers: Membership, Storage and Reminders.
MIT License
100 stars 43 forks source link

Can you to provide IRepository for grain State manipulation? #104

Closed P9avel closed 1 year ago

P9avel commented 1 year ago

Hi. i am have grain public class MyGrain : Grain, /.../ { /.../ }

And state public class MyGrainState { public string Property1 {get;set; } public string Property2 {get;set; } }

I am want to have IMongoRepository with methods

  1. Task<IList> GetList(Predicate filter, CancellationToken cancellationToken)
  2. Task<IList> GetList(Expression<Func<MyGrainState, bool>> predicate, CancellationToken cancellationToken)
  3. Task<IQuarable> GetList(CancellationToken cancellationToken)
  4. Task<List> GetList(string filter, int maxResultCount, int skipCount, string sorting, CancellationToken);

I.e. i am want to get list of States for any Grain (Active or Inactive) with filtering and pagging and show states in grid in UI. Can you to provide so IRepository

SebastianStehle commented 1 year ago

It is not planned from my side, you have to open a PR for that.

P9avel commented 1 year ago

I am think not enougth my knolledges for implemention this task. But i think very important feature

SebastianStehle commented 1 year ago

Nobody has asked for that yet. So I guess it is not that important

P9avel commented 1 year ago

Because nobody know about this. For example i am need to show grains in Grid with filtering, without activation

SebastianStehle commented 1 year ago

Yes, but you could just implement your own storage solution. Or you build a custom class that just uses the same collection.

The problem is that the provider uses JSON.NET for serialization, therefore the individual properties are known by the mongo serializer and you cannot use linq.