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


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

  • 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.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 20, 2025, 18:00