display list of content type

Topics: Customizing Orchard, General, Troubleshooting
Feb 23, 2011 at 6:14 AM

Hi team,


Orchard is great. It’s pleasant working with Orchard.


Using 1-n relation I have created content type Customer and attach address part and contact part


I can create, edit and display content type customer.


But I want to display list of content type customer with all its part data (i.e. with its address and contact) what I should do.


One more thing I want list of object (content type) with all its data (part) in controller, want to do some manipulation on that. So please tell me what service or method to follow.





Rajan J Dmello

Mar 1, 2011 at 9:10 AM

I got it

var cacheKey = DateTime.Now.ToString();            

var customer = _cacheManager.Get(cacheKey, ctx =>  

{string[] ctypes = new string[1];  

ctypes[0] = "Customer";  

var _customer = _contentManager.Query(ctypes).List();

                return _customer;          


it returns IEnumerable<ContentItem>

Mar 1, 2011 at 8:58 PM

Why would you set the cache key to be DateTime.Now??