0

I want to serialize the objects of CSOM to JSON store them. Later nee to deserialize them. I know there is no direct way to do that it will give an error :

"The property or field '----------' has not been initialized. It has not been requested or the request has not been executed. It may need to be explicitly requested"

But somehow I need to serialize and deserialize them.

2
  • Kindly share your code here to understand better Jan 23 '20 at 8:45
  • 1
    Looking at the error, I can say that you are trying to access a property which you have not included in the Load() function. Jan 23 '20 at 8:46
0

Do not attempt to serialize a CSOM object - instead, create an entity model class, populate the model object with the properties you want it to have, and then serialize the model object.

CSOM objects have tons of fields inside them that you do not want or need. Plus, you'll get that field initialization exception because CSOM objects are not fully populated for performance reasons.

1
  • Thanks. That's what is I am trying to do now. Jan 24 '20 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.