D
D
Denis Bredun2020-07-12 00:26:56
C++ / C#
Denis Bredun, 2020-07-12 00:26:56

Why are attributes needed and when should they be used?

Recently I started to study attributes. I understood what it was, but did not understand why and when to apply it. Like, in order to indicate, for example, some restrictions for a class and set a certain behavior for it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
NewDevLab, 2020-07-12
@Luffy1

attributes are some kind of meta-information that can be read by someone and based on which someone makes some decisions.
for example, a method marked with [HttpGet] will only get Get requests from the client.
in general, I say, it is better to start from practice in study. otherwise it turns out to be some kind of spherical. and in the memory will not be deposited and understanding will not come. but when you see how it works, it's a completely different matter. change the method of studying a little to focus on some tasks. otherwise you can ask a lot of questions with about 0 efficiency.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question