Reputation: 29
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:
Also, because of the architecture, I should not use MongoDB attributes for entity properties.
Upvotes: 2
Views: 616
Reputation: 373
You can map your class to another class with same properties with JObject or JToken type , which can be stored in Mongo
Upvotes: 2