c# - Web Api using parameterized constructor using Autofac -
i'm converting smartstore.net project webapi , want create api product smartstore.net database. here property , method:
irepository<product> productrepository; public ienumerable<product> get() { var query = p in _productrepository.table orderby p.name p.published && !p.deleted && p.showonhomepage select p; var products = query.tolist(); return products; }
next step found _productrepository
interface have exsist through parameterized constructor of api controller. have read autofac (here link) can't find class implements irepository interface.
everyboy used smartstore.net can me create example api product or me found class implements irepository interface ?
thanks alot ! ! !
smartstore.net 2.0.1 has integrated support webapi. please have here.
no need create own interface. if want expose custom entities' api, inherit webapientitycontroller<tentity, tservice>
. repository , service implementations injected automatically you.
Comments
Post a Comment