OrleansContrib / Orleans.Providers.MongoDB

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

How set full collection name (not postfix only) #103

Closed P9avel closed 2 years ago

P9avel commented 2 years ago

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?

SebastianStehle commented 2 years ago

Just set the CollectionPrefix to an empty string.

P9avel commented 2 years ago

Many tnx, works!