After extracting data from my MVC Form in the View using JavaScript, I have a JObject obtained from JSON.NET that looks like this:
var jOBject = {"schedule.ID" : 1, "schedule.Name" : "NameSchedule"}
My goal is to convert this JObject into a Schedule object in my C# controller. The Schedule object has properties as follows:
public class Schedule {
public int ID {get;set;}
public string Name {get;set;}
}
I'm facing an issue where I can't simply use
Schedule sched = jsonObject.toObject<Schedule>();
because the property names in the JObject are prefixed with 'schedule'.
Is there a method or technique available for removing the 'schedule' prefix from the JObject keys so that I can perform the conversion effortlessly in one step?