Παρουσίαση με Ετικέτες
Όλες οι Ετικέτε... »
Snippets »
c# (RSS)
Λυπούμαστε, αλλά υπάρχουν άλλα διαθέσιμες Ετικέτες για να φιλτράρετε με αυτές.
-
A custom validation attribute allows you to create metadata, that you can use in the data model to validate data fields. In order to validate when a collection is null or empty, you may create a custom validation attribute, which returns false in case the object is null or empty. [crayon-56d4b8aa38fbd868986865/] You can now decorate classes using this attribute, i.e.: [crayon-56d4b8aa38ff3854591558/] Let’s assume that you have a WebAPI method test/validation, which:...
|
-
In order to sort a collection of objects based on another list that contains the proper order, we can create an extension method that performs a Join between these two collections and pass a func as innerKeySelector argument to allow us to sort this collection based on whatever key we want. Example [crayon-56b287338aceb734717922/]
|