Mangesh barmate

Mangesh barmate

  • NA
  • 118
  • 132.3k

How to change Property name in c#?

Nov 26 2015 7:33 AM

Hi,

I have two property in my Model class. I am using MVC 4. For example i am having below class and its belonging property -

Public Class Test

{

public string Custom1 {get;set;}

public string Custom2 {get;set;}

}

When i am binding this Test model class, it working properly. What i want, i want to keep property name Custom1 and Custom2 but want to change its name.

Means, Custom1 will be there but i am accessing this property with different name like EmailId and Password instead of Custom1 and Custom2.

Please suggest on this.

Thanks.


Answers (2)