I'm new to Umbraco and would appreciate any assistance.
Looking at the example from this page, it seems like I should be able to perform an .OrderBy() on a Dynamic Record list.
But I'm getting the following error:
Compiler Error Message: CS1928: 'Umbraco.Forms.Mvc.DynamicObjects.DynamicRecordList' does not contain a definition for 'OrderBy' and the best extension method overload 'Umbraco.Web.PublishedContentExtensions.OrderBy(System.Collections.Generic.IEnumerable
Line 49: @foreach (dynamic record in list.OrderBy("Created"))
Here is my code (from a Partial View):
@using Umbraco.Forms.Mvc.DynamicObjects
@{
DynamicRecordList list = Library.GetRecordsFromForm("585c459d-a306-4129-80d0-268bdf575c54");
}
@foreach (dynamic record in list.OrderBy("Created"))
{
<tr>
<td>@Convert.ToDateTime(record.Date.Replace(@"\", "")).ToString("MM-dd-yyyy")</td>
<td>@Convert.ToDateTime(record.Date.Replace(@"\", "")).ToString("dddd")</td>
<td>@record.Name</td>
<td>@record.Type</td>
<td>@record.Reason</td>
<td>@record.Comments</td>
</tr>
}
</table>
DynamicRecordList OrderBy() Error
Hello,
I'm new to Umbraco and would appreciate any assistance.
Looking at the example from this page, it seems like I should be able to perform an .OrderBy() on a Dynamic Record list.
But I'm getting the following error:
Compiler Error Message: CS1928: 'Umbraco.Forms.Mvc.DynamicObjects.DynamicRecordList' does not contain a definition for 'OrderBy' and the best extension method overload 'Umbraco.Web.PublishedContentExtensions.OrderBy(System.Collections.Generic.IEnumerable
Line 49: @foreach (dynamic record in list.OrderBy("Created"))
Here is my code (from a Partial View):
Hi Brian,
I have just tried the same, as you can get the same result. So I have create a issue in our issue tracker, so it can be solved.
You can find the issue here. http://issues.umbraco.org/issue/CON-878
/Dennis
is working on a reply...