using (var stream = Request.InputStream)
{
string inputStream = new StreamReader(stream).ReadToEnd();
JavaScriptSerializer jsSerializer = new JavaScriptSerializer();
scheduleEventEntity = jsSerializer.Deserialize<ScheduleEventEntity>(inputStream);
}
foreach (PropertyDescriptor descriptor inTypeDescriptor.GetProperties(scheduleEventEntity))
{
string name = descriptor.Name;
object value;
if (descriptor.PropertyType == typeof(String))
{
value =Microsoft.JScript.GlobalObject.unescape(descriptor.GetValue(scheduleEventEntity));
}
else
{
value = descriptor.GetValue(scheduleEventEntity);
}
if (value.ToString() == "undefined")
{
value = string.Empty;
}
descriptor.SetValue(scheduleEventEntity, value);
}