G
Guest
I have a class Person that includes several properties (i.e. Name, ID) and a
method storeData() that stores these same values to a database.
What's the correct method of instantiating this class when another method in
another class is storing data to the properties and calling storeData()? I'm
currently doing it this way:
protected void Button_Click(...)
{
Person person1 = new Person();
person person2 = new Person();
person1.Name = "John Smith";
person1.ID = "123";
person2.storeData(person1);
}
Is this the correct way?
Thanks.
method storeData() that stores these same values to a database.
What's the correct method of instantiating this class when another method in
another class is storing data to the properties and calling storeData()? I'm
currently doing it this way:
protected void Button_Click(...)
{
Person person1 = new Person();
person person2 = new Person();
person1.Name = "John Smith";
person1.ID = "123";
person2.storeData(person1);
}
Is this the correct way?
Thanks.