1

I've recently changed my Json serialization/deserialization logic from Newtonsoft to JIL,it(Jil) works with better performance than newtonsoft (as expected) but I have one major problem with it

My model objects are usually big objects with lots of properties including their own props and their parent props, so I can't pass the whole object to the client on every request, I usually exclude some of their properties (unnecessary ones).

In newtonsoft I easily used JsonIgnore attribute and my need was satisfied but as I googled a bit I haven't found it's (JsonIgnore) equivalent attribute in JIL.

Does this attribute exists in JIL or I should write it myself??

if the answer is no how can I write an attribute that Ignores property from being serialized with JIL because I have no access to JIL JSON.Serialize mechanism

any help would be hugely appreciated

Code_Worm
  • 4,069
  • 2
  • 30
  • 35

1 Answers1

0

I found the answer myself I should use JilDirective attribute with first property of false see below

[JilDirective(true)]
Code_Worm
  • 4,069
  • 2
  • 30
  • 35