Recidivist
New Member
I am trying to do a blog project and I am using ado.net and I have 3-tier architecture.In one classlibrary I have classes such as \[code\]User\[/code\] and \[code\]Comments\[/code\]:\[code\]public class User{ public int userID{ get; set; } public string userName{ get; set; } public string userPassword { get; set; } public string userMail{ get; set; }}public class Comments{public int ID { get; set; }public int userID{ get; set; }public string commentHeader{ get; set; }public string commentContent{ get; set; }}\[/code\]I want to have a \[code\]userName\[/code\] property in the \[code\]Comments\[/code\] class. And I decided to create an open property in the \[code\]Comments\[/code\] class.Because I will show in these in a UI and I want to see the \[code\]UserName\[/code\] along with \[code\]UserID\[/code\]; for a better understanding about whom send this comment.How I can create the following?\[code\]public string userName{ get { return //(what I have to write here) }}\[/code\]