I am trying to find a way to have an object that is a colleciton but when it is saved to the database becomes a JSON string. How can i set up entity framework 6.1 to do this? Example:
public class Company{
public Company(){
this.Times = new HashSet<DateTime>();
}
public int Id {get;set;}
public string Name {get;set;}
public List<DateTime> Times {get;set;}
}
Company is an entity object. I would like for Times to be stored in the database as a json string of times. I would like it to serialize when reading from the database as a list of date time. I would like the list on save to be converted back to the json string and saved.