OrleansContrib/Orleans.Providers.MongoDB

How set full collection name (not postfix only)

P9avel opened this issue · 2 comments

Hello, i am have Grain
public class UserGrain : Grain, IUser
{
private IPersistentState _userData;

    public UserGrain([PersistentState("Users")] IPersistentState<UserData> userData)
    {
        this._userData = userData;
    }

    public async Task CreateUser(DateTime created)
    {
        _userData.State.Id = this.GetPrimaryKey();
        _userData.State.Created = created;
        await _userData.WriteStateAsync();
    }

    public Task GetCreatedDate() => Task.FromResult(_userData.State.Created);
}

I am wait to have 'Users' collection in MongoDb. But i have 'GrainsUsers'. How to replace full collection name?

Just set the CollectionPrefix to an empty string.

Many tnx, works!