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
Nilesh Shah
11
54.3k
1.3m
Serializing a class: "Serialize" or "DataContractAttribute"?
Feb 15 2017 12:39 PM
What's the difference between using "Serialize" or "DataContractAttribute" while you want to make a class seriallizable?
Compiler warns:
Type 'MyNAmeSpace.MyClass' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. If the type is a collection, consider marking it with the CollectionDataContractAttribute. See the Microsoft .NET Framework documentation for other supported types
.
Why doesno't it suggest using [Serialize] attribute?
P.S. the class is not used for any web service. It's a normal class which I want to write to DB.
Reply
Answers (
3
)
generating PDF using Rotativa Nuget Package
Object Oriented Login Page