I' m building ASP.NET Web API and using MongoDB to store data.
Some of properties should be dynamic at the class as below
public class SampleModel
{
public dynamic Config { get; set; }
public string Name {get; set; }
}
JObject is also used instead of dynamic.
This object couldn' t be inserted properly.
After that I tried to use BSonDocument property instead of dynamic/JOject. It' s working but I have to use the class with Jobject while deserializing data at controller and copied properties one by one to another class with BSonDocument.
I don' t want to copy properties etc. I need more dynamic structure. There should be proper way to do it but I couldn' t find.