Hello community ,
I have to convert a object to json string I try to ignore the properties with a minvalue datetime in my Json string
this is my code convert :
string jsonString = Newtonsoft.Json.JsonConvert.SerializeObject(customerB2B, Formatting.Indented, new JsonSerializerSettings
{
NullValueHandling = NullValueHandling.Ignore
});
this is my Json :
This is my class object :
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace OCM.XRM.Plugins.Objects
{
public class CustomerB2B
{
public string id { get; set; }
public string custNmae { get; set; }
public string custType { get; set; }
public string businessRegister { get; set; }
public DateTime certificateIssueDate { get; set; }
public DateTime certificateExpireDate { get; set; }
public DateTime createDate{ get; set; }
public DateTime updateDate{ get; set; }
}
Does any one Have an idea how to ignore a datetime with a minvalue ?
Pleassse let me know !!
Ps: I work on CRM 2015 on premises
*This post is locked for comments