1

Now that the site blog.codefluententities.com is down, there is no place to get answers to frequent questions. Even the FAQ's and blog at their main website is poor and lacks of any search tool. At the "knowledge center" you can try to search some basic questions but you'll need to custom search at google using the website: key. I've finally found a clue about my last failure using this old promising tool at:

https://www.softfluent.com/product/codefluent-entities/knowledge-center/json-serialization-D2715E9D140C-A6080529C80C

but the key link is pointing to a lost domain and that's the end of the road.

My question is solved at:

CodeFluent Entities adds a TypeConverterAttribute that allows to convert an entity to string using the EntityDisplayName property. Json.NET detects this attribute and wrongly uses it to serialize the entity to JSON. There are 2 solutions:

Remove this attribute if you don't use it by setting Add Runtime Design Attribute to False Use the Json.NET aspect to generate specific Json.NET attribute on generated classes and properties

but there's no information about how to do it.

As SoftFluent states, questions can be post to SO adding the tag, but user's community is poor at knowledge of the product and developer team @meziantou is overloaded

I really hope this project does not fail as it was one of my last bets to a hidden-source company and pray at every out-of-date free-license internet connection dependent renewal for their server not being closed.

Community
  • 1
  • 1
JoeCool
  • 907
  • 1
  • 11
  • 25
  • I'm not an employee of SoftFluent anymore. You can check my current position on my profile page. – meziantou Jan 27 '18 at 21:58
  • 1
    BTW, you should ask SoftFluent how long they will support CodeFluent Entities (support[at]softfluent.com) – meziantou Jan 27 '18 at 22:51
  • Sorry about it. I didn't check your profile and used my out-of-date information. – JoeCool Jan 28 '18 at 13:58
  • It's a good advice to ask SoftFluent about how long they will support but what is scary to me is not about the date, but about what will they do when time is over. Hope license is not on a token period basis and internet connection renewal anymore. – JoeCool Jan 28 '18 at 14:05

2 Answers2

1

CodeFluent Entities adds a TypeConverterAttribute that allows to convert an entity to string using the EntityDisplayName property. Json.NET detects this attribute and wrongly uses it to serialize the entity to JSON. There are 2 solutions:

Remove this attribute if you don't use it by setting Add Runtime Design Attribute to False

The following configuration will prevent CodeFluent Entities from generating [System.ComponentModel.TypeConverterAttribute(typeof(CodeFluent.Runtime.Design.NameTypeConverter))] on generated classes:

<cf:producer name="Business Object Model (BOM)" typeName="CodeFluent.Producers.CodeDom.CodeDomProducer, CodeFluent.Producers.CodeDom">
    <cf:configuration addRuntimeDesignAttributes="false" ... />
</cf:producer>

You can also use the modeler to set this attribute.

Use the Json.NET aspect to generate specific Json.NET attribute on generated classes and properties

If you need to preserve the TypeConverter, you can instruct CodeFluent Entities to add custom JSON.Net attributes on generated classes and properties using the following aspect. The code and usage sample is available on GitHub: https://github.com/SoftFluent/CodeFluent-Entities/tree/master/Extensions/SoftFluent.Json.NET/

meziantou
  • 20,589
  • 7
  • 64
  • 83
  • I have marked your answer but, If I am allowed to, I would like to know where can actual codefluent entities users get information about doubts not contained in documentation page at SofFluent website. Merci beaucoup. – JoeCool Jan 28 '18 at 14:13
  • 1
    You can continue to ask your question on SO. Simon and I will surely answer them. Note that the SoftFluent team also monitors this tag, so they should answer your questions. If you have an doubt ask them directly by email. – meziantou Jan 29 '18 at 01:17
1

To make you more confident : yes this SO tag is still monitored at SoftFluent. There is also the support[at]softfluent.com mailbox that allows to contact the support team directly. The product is still supported and fixes are published when bugs are reported to us. We are preparing a new version targeting .Net Standard 2.0 but will still support the existing version as is. I can not provide yet any timeline though for this new version.

MCR
  • 79
  • 1