A objA = new objA(); objA.Name = "abc"; objA.Address= "xyz"; objA.Save();
A objA = new objA(); objA.Name = "abc"; objA.InitializeProperties("abc", "xyz"); objA.Save()
public class B { public string Name{get;set;} public string Address{get;set;} private OtherClass otherClassObject {get;set;} private void MappObject(ref OtherClass otherClassObject) { otherClassObject.Name = this.Name; otherClassObject.Address= this.Address; } public void Update() { this.MappObject(this.otherClassObject) otherClassObject.Update(); } }
public A(string name, string address) { Name = name; Address = address; } ... A objbA = new objA("abc", "xyz"); objA.Save();
A objA = new A() { Name="abc", Address="xyz" }; objA.Save(); or else you can go for the above solution1 approach.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)