public interface ICustomerEx { void Load(DataRow row); } public class Customer:ICustomerEx { public string Name{get;set;} public string Address{get;set;} void Load(DataRow row) { Name = (string)row["name"]; Address = (string)row["address"]; } }
public class UiCustomer:ICustomerEx { public string Telephone{get;set;} void Load(DataRow row) { Telephone=(string)row["tele"]; } }
public class Customer:ICustomerEx { public string Name{get;set;} public string Address{get;set;} void Load(DataRow row) { Name = (string)row["name"]; Address = (string)row["address"]; //Call load methods in other places that Interface implemented } }
ICustomerEx _Inner;
if (_Inner != null) { _Inner.Load(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)