I usually initiate an instance of an object and associate some Properties like this.
RegisterModel registerModel = new RegisterModel();
registerModel.UserName = userName;
registerModel.OpenID = openID;
registerModel.Password = password;
registerModel.ConfirmPassword = confirmPasswod;
I found verbose repeating the instance name for each property.
Could you show alternative ways (probably more elegant that mine) to achieve the same result?
I’m new at programming so an example of code would be great thanks
You can do this via object initializers:
Other way would be to do it via constructor.