Scott
Scott

Reputation: 2760

C# Attributes Order - Serializable - D

Does the order of attributes matter?

Is this:

[Serializable]
[DataContract(Name = "GuUser")]
[TSF.Attributes.Entity(
    ConnectionKey = "usergroup",
    TableName = "gu_user",
    InsertCommand = "usp_gu_addguuser",
    UpdateCommand = "usp_gu_updateguuser",
    DeleteCommand = "usp_gu_deleteguuser",
    SelectCommand = "usp_gu_getguuser")]
public class User : TSF.Base.BaseEntity

the same as this:

[DataContract(Name = "GuUser")]
[TSF.Attributes.Entity(
    ConnectionKey = "usergroup",
    TableName = "gu_user",
    InsertCommand = "usp_gu_addguuser",
    UpdateCommand = "usp_gu_updateguuser",
    DeleteCommand = "usp_gu_deleteguuser",
    SelectCommand = "usp_gu_getguuser")]
[Serializable]
public class User : TSF.Base.BaseEntity

The second way says "not serializable". I can't try the first way. Perhaps the error is not related. But, does the order matter?

Upvotes: 0

Views: 227

Answers (1)

MartinZPetrov
MartinZPetrov

Reputation: 316

The order in which attributes are specified in such a list, and the order in which sections attached to the same program entity are arranged, is not significant.

For instance, the attribute specifications [A][B], [B][A], [A, B], and [B, A] are equivalent.

Source: http://msdn.microsoft.com/en-us/library/aa664616(v=vs.71).aspx

Upvotes: 1

Related Questions