Update README.md
This commit is contained in:
committed by
GitHub
parent
f95988269c
commit
1114b6531d
@@ -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>`.
|
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
|
#### 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
|
```csharp
|
||||||
using MongoDbGenericRepository.Attributes;
|
using MongoDbGenericRepository.Attributes;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user