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.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11