KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a class which contains a property: public bool IsMandatory {get;set;} Now I am adding a method IsMandatory(string str) . public bool IsMandatory(string str) { //return false; //return true; } I am getting a compile time error that the type already contains a definition for 'IsMandatory' Can't a method name and property name be same in C# ? We use a method and property in different way, why is this giving compile error ?
Tags (comma-separated)
Save Edits
Cancel