In existing LOB app, I added new Web API project. Because of existing layers in app (Domain objects,DAL-ADO.NET-DataReader, BLL), I decided to use the Web API by holding the existing logic.
First question: Is this a right way?
There is a method in BLL which return list of object, and receives 4 parameters. All of this input parameters can be NULL, and in that case,the method returns full list of objects.
Second question: How to design WEB api controller for the aforementined method?
public static List<DomainObject> GetTata(int? param1,int? param2, int? param3, int? param4)
{
List<DomainObject> return = new List<DomainObject>();
using (Context context = new Context())
{
return = MyDAL.GetData(param1,param2,param3,param4, context);
}
return return ;
}