Andrei,
I have been following the updates on codeplex for some time now and I am really excited about the changes. However, I was trying to jump ahead and play with the new Razor view engine but I ran into a structuremap issue in the DIRegistry.cs file.
Question: How do you plan on wiring up the various interfaces in the registry?
I cannot seem to get past the IDbContext "PluginFamily" error. I just don't quite get the logic of how to wire that up.
I followed your general pattern you commented out and structuremap did not complain. Like this if you wanted to implement a Product controller and view:
DIRregistry.cs
For<ICacheManager>().Use<NopNullCache>();
For<IRepository<Product>>().Use<EfRepository<Product>>();
For<IProductService>().Use<ProductService>();
etc.
Maybe my entire approach is wrong (structuremap is a bit new to me) but do you have any idea how to map IDbContext?
I know this is pulling the cart before the horse a bit but I wanted to get an idea of how the front end will work with the Razor templates.
Any help would be appreciated. Thanks Andrei.
trevor
UPDATEFor anyone else who is interested in "Jumping Ahead" with 2.0 you can wire up the DIRegistry like so:
This is for a Product.
For<IDbContext>().Use(() => new NopObjectContext("YourConnectionStringName"));
For<ICacheManager>().Use<NopNullCache>();
For<IRepository<Product>>().Use<EfRepository<Product>>();
For<IRepository<ProductCategory>>().Use<EfRepository<ProductCategory>>();
For<IRepository<ProductManufacturer>>().Use<EfRepository<ProductManufacturer>>();
For<IRepository<ProductVariant>>().Use<EfRepository<ProductVariant>>();
For<IRepository<RelatedProduct>>().Use<EfRepository<RelatedProduct>>();
For<IRepository<CrossSellProduct>>().Use<EfRepository<CrossSellProduct>>();
For<IRepository<TierPrice>>().Use<EfRepository<TierPrice>>();
For<IProductService>().Use<ProductService>();
Couple of notes:
1. This may not be the best way to wire up StructureMap. This is what I "figured" out and it works so far. I haven't done any testing on this method. I would only recommend doing this if you want play with some controllers and views.
2. For any other entity you would simply add the necessary repositories and service classes that the Service uses in its constructor.
Hope this helps. Comments welcome.