Could give me some reasonable real-life examples of
Generic Methods in .NET for some simple desktop application?
Which the scenarios are there available?
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The most commonly used generic methods are probably the extension methods in
EnumerableandQueryable, i.e. the ones forming LINQ.To go back a bit earlier,
List<T>.ConvertAll<TOutput>is a good example of converting a list of one type (T) to another type (TOutput). In this case the type is generic (theTofList<T>and the method is also generic (inTOutput).