Open Closed

how we can set the custom guid as “object Type” in Mongo DB #1336


User avatar
0
alper created
Support Team Director

Vijay P. Nallala asks:

Can you please suggest – how we can set the custom guid as “object Type” in Mongo DB

Class


Public class TestClass  :Entity<string>
{
        public string Id { get; set};
        public string FirstName { get; set};
}

Repo- ModelBinding

modelBuilder.Entity<TestClass>(b =>
            {
//[BsonRepresentation(BsonType.ObjectId), BsonElement("_id")]

                b.CollectionName = "TestMember";
                b.BsonMap.MapProperty(x => x.Id).SetElementName("_id");
              //TODO SET THE BsonType as ObejctId “NOT AS BINARY”
            });


Thanks Vijay

Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Same question https://support.abp.io/QA/Questions/1277#answer-ac625415-03d3-8d1b-abf9-39fc6c6111d3

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    ServiceBot created
    Support Team Automatic process manager

    This question has been automatically marked as stale because it has not had recent activity.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 05, 2026, 11:32
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.