0
votes

I have my business logic layer and data access layer in separated dll , I used active record design pattern to build my bll ... now I need to host my bll and dal in my mvc project .. I tried to make classes in my models and inherits it's properties and methods from bll (which in another dll) but when I tried to assign base class to inherited one it gives me exception

//Customer class located in mvc model folder which inhireted from EgxCustomer that located in bll in another project
using Egx.EgxBusiness.Inventory;
namespace EgxNMWeb.Models
{
public class Customers:EgxCustomer
{

}
}

//here i try to assign list of EgxCustomer to list of customer
 using Egx.EgxBusiness.Inventory;
 namespace EgxNMWeb.Models
 {
 public class CPanelVM
 {
    Customers currentCustomer { get; set; }
    List<Customers> AllNetwork { get; set; }
    public CPanelVM() 
    {
        AllNetwork = NMModel.GetCustomerNetwork(currentCustomer.CUST_CODE,    Egx.EgxBusiness.Inventory.NM.REF_TYPE.ALL);
    }
   }
   }

what can I do to use my bll which located in another project in my mvc project ?

1
What is the exception that you are getting?Adarsha
can't parse from Customer to EgxCustomerZiad Elnaggar

1 Answers

0
votes

There is no need for your model classes to be in Models folder. It is just a way to form your code structure (although your view must be in Views folder by default). You can directly use your business logic layer models in your controllers if you want.

I think in your project you can place view models in Models folder.