My system has this pattern DAO->Objects->facade->View
so i have a DAO to query database, and instantiate objects, this objects has only attributes (just a container / entity), i want to use LINQ in DAO part, but i dont realize how to pass my objects becouse LINQ generate 1-per table.
namespace ykpObjects.Objects
{
public class Customer
{
public string name { get; set; }
public Cidade()
{
cidadeID = 0;
}
}
}
namespace ykpData.Components.MSSQL
{
public class CustomerDC : DataComponentCM, ICustomerDC
{
Customer ICustomerDC.RecuperaPorID(int CustomerID)
{
Customer Customer = new Customer();
using (MDDataContext omd = new MDDataContext(base.PreencherConexao()))
{
sp_mkp_Customer_SelectByIDResult result = omd.sp_mkp_Customer_SelectByID(CustomerID).SingleOrDefault();
if (result == null)
return null;
Customer.name = result.name;
return Customer;
}
}
}
}
I use DAO to call sprocs, so i get sproc results and instanciate a object of Customer for exemple, and pass this to control, now i want to change to linq but i dont wanna change all object structure to minimalize the impact.
Any advice ?
Objectssection of your design does not mean anything to me. Please elaborate.