Difference between Data Member and Feilds

rupeshkumar 1 Reputation point
2021-02-11T23:14:55.643+00:00

Whats the Difference between Data Member and Feilds

.NET
.NET
Microsoft Technologies based on the .NET software framework.
3,922 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Ken Tucker 5,856 Reputation points
    2021-02-12T01:36:35.397+00:00

    A DataMember is seriallized by a datacontract serializer. Fields that are not marked as DataMember will not be included in the data contract

    https://learn.microsoft.com/en-us/dotnet/api/system.runtime.serialization.datamemberattribute?view=net-5.0

    0 comments No comments

  2. Sam of Simple Samples 5,546 Reputation points
    2021-02-12T18:06:43.287+00:00

    First you need to understand that Microsoft tends to be careless about names. Many names that they choose are confusing. For example Visual Studio and Visual Studio Code sound alike but they are very different. Also the name Core is used in confusing ways.

    As indicated by vb2ae, Microsoft uses the name DataMember in a specific manner but that seems to be another example of confusing terminology. Generally speaking, the term member is very general. I am not aware of a specific official definition of member relevant to .Net (as in dotnet Difference between Data Member and Fields - Google Search). And see syntax - Programming terms - field, member, properties (C#) - Stack Overflow; it says:

    *"Member" is most commonly used in C++ to refer to member functions, member variables, and so on*
    

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.