TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Hakan Axheim
NA
201
32.4k
Reading an XML file using DataContracts
Mar 5 2021 12:03 PM
Hi,
I am trying to DeSerialize this XML file with DataContracts.
string
xmlData = @"<?xml version=
'1.0'
encoding=
'utf-8'
standalone=
'yes'
?>
<objects ResultsRemaining=
'0'
>
<
object
><id>CF7E7B22-1D3A-4CFE-91F9-F8C5C2DB4069</id>
<parentid>ED98C97F-A202-48ED-AEEA-34362508A30B</parentid>
<name>NorthernLights</name>
<type>file</type>
<dateadded>1614924419</dateadded>
<permissions>
<read />
<write />
<saveanno />
<publishanno />
<viewrmeta />
<viewmacro />
<viewlabel />
<copyexport />
<share />
<downloadslide />
</permissions>
<content>
<file>
<filepath>68934805-fa78-4d84-aac1-fbcde4a7a8f2.png</filepath>
<mime>image/png</mime>
</file>
</content>
</
object
>
</objects>";
I have created this structure with classes:
Objects -- Object -- Permission
Content --- File
I have no errors when I DeSerialize the XML data but no objects will be created.
My code is as follow;
Objects objects =
new
Objects();
objects = dataCSUtility.DeSerializer<Objects>(xmlData);
Nothing will be assigned to objects!
Can anybody solve this?
Reply
Answers (
3
)
Cofoundry CMS in Asp.net core.
Global variable initialized when DLL is loaded.