Ouvert Fermé

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


User avatar
0
alper créé
Équipe d'assistance 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 Réponse (s)
  • User Avatar
    0
    maliming créé
    Équipe d'assistance Fullstack Developer

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

  • User Avatar
    0
    ServiceBot créé
    Équipe d'assistance 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 mars 25, 2024, 15:11