Update README.md

This commit is contained in:
Alexandre SPIESER
2018-09-27 22:20:45 +01:00
committed by GitHub
parent f95988269c
commit 1114b6531d
+1 -1
View File
@@ -44,7 +44,7 @@ public class ApplicationRole : MongoIdentityRole<Guid>
The `Id` field is automatically set at instantiation, this also applies to users inheriting from `MongoIdentityUser<int>`, where a random integer is assigned to the `Id`. It is however not advised to rely on such random mechanism to set the primary key of your document. Using documents inheriting from `MongoIdentityRole` and `MongoIdentityUser`, which both use the `Guid` type for primary keys, is recommended. MongoDB ObjectIds can optionally be used in lieu of GUIDs by passing a key type of `MongoDB.Bson.ObjectId`, e.g. `public class ApplicationUser : MongoIdentityUser<ObjectId>`.
#### Collection Names
MongoDB collection names are set to the plural camel case version of the entity class name, e.g. `ApplicationUser` becomes `applicationUsers`. To override this behavior apply the `CollectionName` attribute to MongoDbGenericRepository:
MongoDB collection names are set to the plural camel case version of the entity class name, e.g. `ApplicationUser` becomes `applicationUsers`. To override this behavior apply the `CollectionName` attribute from the `MongoDbGenericRepository` nuget package:
```csharp
using MongoDbGenericRepository.Attributes;