I have 3 layers in my solution:
- DAL (which is accessing my DB with LINQ)
- Business layer
- Winform
In my DAL, I am returning a List
with a specific type from my DB and I'm doing the same in my BLL.
When I want to use my function in my UI I get the error:
The type 'Reservation' is defined in an assembly that is not referenced...
Now I want to avoid having to reference my DAL in my UI.
As I'm new to this and couldn't find a clear answer on the web, could anyone help me out please?
My DAL function
public static List<Reservation> SelectListReservation()
{
try
{
List<Reservation> lstReservation = new List<Reservation>();
lstReservation = oExamenSgbdEntities.Reservations.ToList();
return lstReservation;
}
catch (Exception e)
{
throw e;
}
}
My BLL function
public static List<DataAccess.Reservation> GetListReservation()
{
try
{
List<DataAccess.Reservation> lstToReturn = new List<Reservation>();
lstToReturn = GetListReservation();
return lstToReturn;
}
catch (Exception e)
{
throw e;
}
}
How I call my BL function in my UI:
var lstRes = Manage.GetListReservation();