0
var dynamicEdmIndexObject = new DynamicEdmComplexObject();
dynamicEdmIndexObject.Properties["Provider Name"] = 
providerApiInfo.Properties["ProviderName"].ToString();

The actual provider name that I'm storing is P&ID but the result is coming as P\u0026ID.

How to prevent this?

Lorenzo
  • 3,293
  • 4
  • 29
  • 56
  • its getting encoded. try decoding it – prisar Sep 27 '18 at 04:59
  • What is `providerApiInfo`? What is the dynamic type of `providerApiInfo.Properties["ProviderName"]`? Does it have a custom `ToString()` implementation? – Raymond Chen Sep 27 '18 at 05:00
  • Kindly share complete sample code. – Sham Sep 27 '18 at 05:00
  • "&" == "\u0026" – shingo Sep 27 '18 at 05:03
  • Possible duplicate of [Convert a Unicode string to an escaped ASCII string](https://stackoverflow.com/questions/1615559/convert-a-unicode-string-to-an-escaped-ascii-string) – Fabjan Sep 27 '18 at 05:20
  • @RaymondChen am getting providerApiInfo from MongoDB like below `var providerApiInfo = (new CrudManager(0)).ReadOne(providerId, "_id") as ProviderApi;` When I checked value for provider name in MongoDB it is "P&ID" but when I see value after ToString() it is P\u0026ID. it is not having any custom ToString() implementation. – Vamshidhar Reddy Enumula Sep 27 '18 at 06:56

0 Answers0