sitecore8 - Sitecore glassmapper how to fetch the datasource from the rendering -


need suggestion on sitecore rendering want use glassmodel render item.

i have page , has many renderings , each renderings has data source associated it.

i know below statement give me current context, not datasource item.

var context = new sitecorecontext();             model = context.getcurrentitem<homepage>(); 

what best option solve query? gave gone through this article. i'm not convinced method i'm using ioc (windsor castle) , have write unit test cases each method. may have mock these objects later. i'm looking approach using interface not class.

appreciate help.

if controller derived glasscontroller can use getdatasourceitem<i..>(). give datasource.


Comments

Popular posts from this blog

c# SetCompatibleTextRenderingDefault must be called before the first -

C#.NET Oracle.ManagedDataAccess ConfigSchema.xsd -

c++ - Fill runtime data at compile time with templates -