Click here to Skip to main content
14,739,240 members
Home » Discussions » Database
   

Database

 
AnswerRe: SQL Header Detail Last Number Problem (overlap identity saving Details) Pin
CHill6017-Oct-18 6:05
mveCHill6017-Oct-18 6:05 
GeneralRe: SQL Header Detail Last Number Problem (overlap identity saving Details) Pin
Richard Deeming17-Oct-18 10:04
mveRichard Deeming17-Oct-18 10:04 
QuestionNeed good, easy to manage "mail merge" program, free or not Pin
Charles Wolfe7-Oct-18 22:39
MemberCharles Wolfe7-Oct-18 22:39 
AnswerRe: Need good, easy to manage "mail merge" program, free or not Pin
Victor Nijegorodov8-Oct-18 9:32
MemberVictor Nijegorodov8-Oct-18 9:32 
GeneralRe: Need good, easy to manage "mail merge" program, free or not Pin
Charles Wolfe9-Oct-18 20:47
MemberCharles Wolfe9-Oct-18 20:47 
GeneralRe: Need good, easy to manage "mail merge" program, free or not Pin
CHill6017-Oct-18 9:45
mveCHill6017-Oct-18 9:45 
QuestionError passing MongoDB ObjectID back to .Net Core 2.1 Controller Pin
jkirkerx27-Sep-18 13:41
professionaljkirkerx27-Sep-18 13:41 
AnswerRe: Error passing MongoDB ObjectID back to .Net Core 2.1 Controller Pin
Nathan Minier28-Sep-18 2:19
professionalNathan Minier28-Sep-18 2:19 
It looks like a fairly standard serialization error. I don't think you need the BsonRepresentationAttribute here.

Have you had a look at the docs:
Mapping Classes

The default for Id mapping is the string type, but you can use ObjectId as you are, but you need to set a specific IdGenerator.

Going through the references for the various IdGenerators in the MongoDB.Bson.Serialization.IdGenerators namespace, it looks like there are 3 candidate generators for ObjectId. I don't know which one is more appropriate for your use case, but if I were to venture a guess the general ObjectIdGenerator should be appropriate:
MongoDB.Bson.Serialization.IdGenerators Namespace

So, your mapping ultimately should look like:
[BsonId(IdGenerator = typeof(ObjectIdGenerator)]
public ObjectId Id { get; set; }
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor

GeneralRe: Error passing MongoDB ObjectID back to .Net Core 2.1 Controller Pin
jkirkerx28-Sep-18 9:02
professionaljkirkerx28-Sep-18 9:02 
GeneralRe: Error passing MongoDB ObjectID back to .Net Core 2.1 Controller Pin
jkirkerx28-Sep-18 9:17
professionaljkirkerx28-Sep-18 9:17 
GeneralRe: Error passing MongoDB ObjectID back to .Net Core 2.1 Controller Pin
Nathan Minier28-Sep-18 9:45
professionalNathan Minier28-Sep-18 9:45 
GeneralRe: Error passing MongoDB ObjectID back to .Net Core 2.1 Controller Pin
jkirkerx28-Sep-18 13:18
professionaljkirkerx28-Sep-18 13:18 
AnswerRe: Error passing MongoDB ObjectID back to .Net Core 2.1 Controller Pin
jschell28-Sep-18 12:25
Memberjschell28-Sep-18 12:25 
GeneralRe: Error passing MongoDB ObjectID back to .Net Core 2.1 Controller Pin
jkirkerx28-Sep-18 13:44
professionaljkirkerx28-Sep-18 13:44 
AnswerMessage Closed Pin
21-Oct-18 23:40
MemberMember 1402786821-Oct-18 23:40 
QuestionRun correctly from code VB.NET Pin
Computechsoft23-Sep-18 23:07
MemberComputechsoft23-Sep-18 23:07 
AnswerRe: Run correctly from code VB.NET Pin
Richard MacCutchan23-Sep-18 23:13
mveRichard MacCutchan23-Sep-18 23:13 
GeneralRe: Run correctly from code VB.NET Pin
Computechsoft23-Sep-18 23:34
MemberComputechsoft23-Sep-18 23:34 
GeneralRe: Run correctly from code VB.NET Pin
Richard MacCutchan23-Sep-18 23:50
mveRichard MacCutchan23-Sep-18 23:50 
GeneralRe: Run correctly from code VB.NET Pin
Computechsoft24-Sep-18 0:02
MemberComputechsoft24-Sep-18 0:02 
GeneralRe: Run correctly from code VB.NET Pin
Richard MacCutchan24-Sep-18 0:11
mveRichard MacCutchan24-Sep-18 0:11 
GeneralRe: Run correctly from code VB.NET Pin
Richard Deeming24-Sep-18 9:13
mveRichard Deeming24-Sep-18 9:13 
AnswerRe: Run correctly from code VB.NET Pin
thatraja24-Sep-18 0:21
professionalthatraja24-Sep-18 0:21 
QuestionHow to retrieve List content in JSP from Hibernate Query Language Pin
Mr ARUL SUJU D15-Sep-18 13:38
MemberMr ARUL SUJU D15-Sep-18 13:38 
Questionstoring a byte[] array in MongoDB Pin
jkirkerx6-Sep-18 13:42
professionaljkirkerx6-Sep-18 13:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.