Ok I have a project working now which has a UseData Class which is an
empty datastructure and i have a UserCRUD class which i can use to
prefill it. I have moved up to my Business logic layer and now want to
put all of this together
my UserData class has the following properties
Username
Password
Email
my UserLogin Class inherits from UserData and has the Login and Logout
Methods
I want my UserLogin.Login method to fill the Username, Password and
Email properties of UserLogin from the database
i have UserCRUD.Get(username.password) which returns a UserData
structure - given that my UserLogin Class was inherited from UserData
is there any way i can map the return from UserCRUD.Get directly onto
my UserLogin Class or will i have to do something like
UserLogin myUserLogin=(UserCRUD.Get(user,pass);
this.m_UserName=myUserLogin.Username;
this.m_Email=myUserLogin.Email;
within my UserLogin method? I am basically trying to avoid having to
continually do the above property by property assign, is my approach
ok, or am i being a complete idiot? This is my first attempt at real
OO N-tier project and i am trying to get the theory perfect before i
do something more complicated, apologies if my explination isnt too
good.
Regards
Owen
Kevin Yu [MSFT] - 10 May 2006 02:23 GMT
Hi Owen
As far as I know, we have to do the assigning in code manually. However,
there are some 3rd party tools that can generate the assigning code for
you. Sorry that I could not remember the name, but I think you can find
many of them by searching through google.
Kevin Yu
Microsoft Online Community Support
============================================================================
==========================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
============================================================================
==========================
(This posting is provided "AS IS", with no warranties, and confers no
rights.)