Is there any short way of auto generating poco class from an existing method with parameters?
public void RegisterUser(string userName, string fullName,
string tel, string mobile, string website, string address, string blah){
//--
}
from this method I should be able to auto generate my class as below:
class UserRegisterDetail{
public string UserName {get;set;}
public string FullName {get;set;}
public string Tel {get;set;}
public string Mobile {get;set;}
public string Website {get;set;}
public string Address {get;set;}
public string Blah {get;set;}
}
I use resharper and re-factoring but I cannot generate the simple poco class.
Update:
Using "Extract class from parameters" option generates the following:
public class RegisterUserParams
{
private string userName;
private string email;
private string fullName;
private string jobTitle;
private string department;
private string tel;
private string mobile;
private string switchboard;
private string fax;
private string address1;
private string address2;
private string address3;
public RegisterUserParams(string userName, string email, string fullName, string jobTitle, string department, string tel, string mobile, string switchboard, string fax, string address1, string address2, string address3 )
{
this.userName = userName;
this.email = email;
this.fullName = fullName;
this.jobTitle = jobTitle;
this.department = department;
this.tel = tel;
this.mobile = mobile;
this.switchboard = switchboard;
this.fax = fax;
this.address1 = address1;
this.address2 = address2;
this.address3 = address3;
}
public string UserName
{
get { return userName; }
}
public string Email
{
get { return email; }
}
public string FullName
{
get { return fullName; }
}
public string JobTitle
{
get { return jobTitle; }
}
public string Department
{
get { return department; }
}
public string Tel
{
get { return tel; }
}
public string Mobile
{
get { return mobile; }
}
public string Switchboard
{
get { return switchboard; }
}
public string Fax
{
get { return fax; }
}
public string Address1
{
get { return address1; }
}
public string Address2
{
get { return address2; }
}
public string Address3
{
get { return address3; }
}
}