Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Brian 1 post 71 karma points
    Jan 20, 2016 @ 20:55
    Brian
    0

    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):

    @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>
    
  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Jan 21, 2016 @ 09:43
    Dennis Aaen
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft