Telerik Sitefinity - Sorting data selected -


i has code below retrieve data

type dtype = typeresolutionservice.resolvetype("telerik.sitefinity.dynamictypes.model.schedule.schedulemanagement");          // how collection of event items         var mycollection = dynamicmodulemanager.getdataitems(dtype).where(i => i.status == contentlifecyclestatus.live && i.visible && i.getvalue<string>("title").tostring() == channel + " schedule").firstordefault();         // @ point mycollection contains items the type           return mycollection; 

any idea how can sorting data been selected? please help.

firstly need remove .firstordefault() returns single item (or null) not collection.

to sorting in linq need use .orderby()

eg, order title.

type dtype = typeresolutionservice.resolvetype("telerik.sitefinity.dynamictypes.model.schedule.schedulemanagement");      // how collection of event items     var mycollection = dynamicmodulemanager.getdataitems(dtype).where(i => i.status == contentlifecyclestatus.live && i.visible && i.getvalue<string>("title").tostring() == channel + " schedule").orderby(p=> p.getvalue<string>("title"));     // @ point mycollection contains items the type       return mycollection; 

Comments

Popular posts from this blog

c# - ReportViewer control - axd url -

c# - must be a non-abstract type with a public parameterless constructor in redis -

jquery - Why is my content spilling past the bottom of the container? -