Click here to Skip to main content
15,910,886 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi ,

how can we implement constraints on generics,
i was google lot of stuff was there but i was unable to understand.

so kindly provide one easiest method Ex:
C#
class Emp
{
p int Id{get,set;}

}

take the above example and explain us

Regards
James
Posted
Updated 13-May-12 22:14pm
v2
Comments
OriginalGriff 14-May-12 4:15am    
Sorry?
You example doesn't use generics, so what do you want us to help you with?
Pete O'Hanlon 14-May-12 8:19am    
You need to fix your example here. You haven't included any generics in there so we can't explain them, nevermind explaining how constraints work.

 
Share this answer
 
i knew about the link

im looking for the simple explanation.
 
Share this answer
 
Comments
Pete O'Hanlon 14-May-12 8:25am    
You have added a solution here, not a comment to Mehdi, so unless he happens to come back and look at this question, he won't know that you've commented. To add a comment, click the "Have a Question or Comment?" button on the solution you want to ask questions about. BTW - you really need to sort your example out so that we can give a proper explanation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900