dotnetomaniak.pl - Artykuły z tagiem Attribute

Model validation is one of those things you will never escape. It can haunt you, it can enlarge your controller’s codebase uncontrollably, it can finally piss you off. But it can be done very easily. How? Let me show you that step by step.

Dziel się z innymi:
Model validation using attributes - blog.mariuszklimek.eu

Web 2334 dni, 23 godziny, 37 minut temu mauriceklimek 84 źrodło rozwiń

C# Attributes are very popular for ‘decorating’ assembly with some additional data, usually influencing on the application’s behavior or the way data are managed. You probably already used at least some of them – Obsolete, Serializable, Required, Display, MaxLength, RegularExpression, WebMethod are only a few of hundreds available in .Net world. What is more, you can write your own custom attribute and use it like a build-in one. I will write more about this in the next post. Right now, let’s focus o...

Dziel się z innymi:
C# Attributes – introduction – A Girl Among Geeks

Sztuka programowania 2480 dni, 21 godzin, 50 minut temu AGirlAmongGeeks 166 źrodło rozwiń

TypeScript daje nam możliwość dekorowania kodu podobną do tej, którą mamy w C# w postaci atrybutów. Czy oba mechanizmy są tym samym, czy jednak czymś się różnią ?

Źródło: mickl.net
Dziel się z innymi:
Atrybuty w C# vs Dekoratory w TypeScript

Web 2621 dni, 10 godzin, 24 minuty temu mickl 175 źrodło rozwiń

Jeśli API, z którego musisz skorzystać dostarcza Ci dane w 'brzydkiej' formie, zmapuj je. Dodaj warstwę abstrakcji i ukryj złe struktury.

Tagi: API, Attribute
Źródło: devblog.dymel.pl
Dziel się z innymi:
Abstract the data from the API - Michał Dymel - DevBlog

Sztuka programowania 2898 dni, 21 godzin, 4 minuty temu Michal Dymel 158 źrodło rozwiń

Czasami pisząc kod stwierdzamy, że chcemy w jakiś sposób opisać nasze typy w taki sposób, aby można było się do tego odnieść w kodzie. Z pomocą przychodzą nam dwie funkcjonalności .NETu: Reflection i atrybuty. Czym są atrybuty? ...

Dziel się z innymi:
Atrybuty - jak i po co? - MD Tech Blog

Daj się poznać 2016 3041 dni, 5 godzin, 29 minut temu manio143 191 źrodło rozwiń

It is a common practice to validate function arguments before running actual code. Usually validation looks like that: public void Update(Car entity) { if(entity ==null) throw new ArgumentNullException("entity"); } There is nothing wrong with this code, however we have to repeat this piece of code in every function. Of course we could create some helper class for argument validation and call approperiate validation function before launching...

[EN] Argument validation with attributes and Ninject interceptor

Windows 4286 dni, 14 godzin, 54 minuty temu nocturn 33 źrodło rozwiń

Platforma .NET pozwala na definiowanie metadanych, czyli pewnych informacji opisujących różne elementy kodu. Funkcjonalność ta realizowana jest poprzez atrybuty. Atrybuty używane mogą być do opisu takich elementów jak klasy, metody, zdarzenia, pola, właściwości oraz wielu innych. Oprócz szeregu zdefiniowanych atrybutów mamy możliwość tworzenia własnych.

Dziel się z innymi:
Definiowanie oraz odczyt własnych atrybutów « Developer notes

Inne 4287 dni, 19 godzin, 16 minut temu psz750 119 źrodło rozwiń

Najaktywniejsi w tym miesiącu