Deserialize to self

前端 未结 4 598
灰色年华
灰色年华 2021-01-11 18:08

Ok, I\'m probably just having an epic fail here, but my mind wants to say this should work.

Assume DataProtect.DecryptData takes an encrypted string as input and a d

4条回答
  •  清酒与你
    2021-01-11 18:17

    You can not assign anything to "this". Change ArriveDetails to a static that return the deserialised object.

    class ArrivedDetails
    {
        static ArrivedDetails Create(string encrypted)
        { return DataProtect.deserializeXML(...) }
    }
    

提交回复
热议问题