1

I'm trying to store an object in the document. This is my entity:

public Guid Id { get; set; } 
public string CreatedBy { get; set; } 
public string CreatedByIp { get; set; } 
public DateTime CreatedAt { get; set; }  
public string LastUpdatedBy { get; set; } 
public string LastUpdatedByIp { get; set; } 
public DateTime? LastUpdatedAt { get; set; }
public object LastContext { get; set; } 

LastContext object that contains multiple properties must be stored in the document, but this is what is stored in the document:

enter image description here

Also, because of the architecture, I should not use MongoDB attributes for entity properties.

Mohsen Esmailpour
  • 11,224
  • 3
  • 45
  • 66

1 Answers1

2

You can map your class to another class with same properties with JObject or JToken type , which can be stored in Mongo

1SaeedSalehi
  • 364
  • 1
  • 8
  • 16