Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Handling DB Nulls
Message
De
29/12/2009 02:33:44
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
01440804
Message ID:
01441012
Vues:
30
>>>Did no one look at this (other than Gregory who replied already)?!?!?
>>
>>You may have noticed that extension methods are a pet of mine
>
>You're really good at it! Can you quickly explain where syntax in it - I was learning Extension methods recently while learning LINQ stuff, but I already forgot a bit.


What's happened to your google capabilities ?

The WHERE restricts the classes it applies to.



See possible clauses : http://msdn.microsoft.com/en-us/library/d5x73970.aspx
They can be combined - it's an AND combination

If you want to use eg between/max, .., you want the type to implement IComparable(T)
public static bool Between<T>(this T s, T s1, T s2) where T : IComparable<T>

public static T Max<T>(params T[] array) where T : IComparable<T>
For an InList you'll need IEquatable(T)
public static bool InList<T>(this T s, params T[] array) where T : IEquatable<T>
		{
			return array.Contains(s);
		}
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform