object obj = new { Provider = appointmentErpStoreEntity.ProvinceName, City = appointmentErpStoreEntity.CityName, District = appointmentErpStoreEntity.CountyName, Address = appointmentErpStoreEntity.Address }; addressInfo = JsonConvert.SerializeObject(obj);
如果赋值为null,一样可以转换成json,
变成:{“Provider”:null,”City”:null........}