C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
2
Reply
what are attributes in .NET ?
Santosh Kumar Kotnala
15y
5.5k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
An
attribute
is a declarative tag that is used to convey information to runtime about the behaviour of programmatic elements such as classes,enumerators and assemblies.
A declarative tag is represented by
square brackets []
above the definition of the elements that is it can be above the class or it can be above the method .
For example:
[attribute(positional parameters,named parameters)]
Here, in the above example positional parameters are essential information of an attribute whereas name parameters are the optional information of an attribute.
sarika jain
14y
0
Attributes provide a powerful method of associating metadata, or declarative information, with code (assemblies, types, methods, properties, and so forth). After an attribute is associated with a program entity, the attribute can be queried at run time by using a technique called
reflection
.
Manish Dwivedi
15y
0
what is diffreence between abstract and virtual method in csharp ?
what is diffreence between Out and ref in C# ?
Message