Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6912171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:03:30+00:00 2026-05-27T09:03:30+00:00

I have a list that holds objects of type dynamic. When I use the

  • 0

I have a list that holds objects of type dynamic. When I use the LINQ OrderBy method, I get an error saying ‘object’ does not contain a definition for ‘Date’. What can I do to sort my list by the date?

List<dynamic> employees = new List<dynamic>();

employees.Add(new
{
    ID = 1,
    Name = "Larry",
    Date = new DateTime(2010, 10, 1),
});

employees.Add(new
{
    ID = 2,
    Name = "Clint",
    Date = new DateTime(2011, 5, 28),
});

employees.Add(new
{
    ID = 3,
    Name = "Jason",
    Date = new DateTime(2011, 7, 6),
});

var query = employees.OrderBy(x => x.Date);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:03:31+00:00Added an answer on May 27, 2026 at 9:03 am

    Is the code that you’ve shown in the same Assembly?

    Anonymous Types won’t work across assemblies, and the “Object doesn’t contain this definition” error is a typical sign of using an anonymous type from two different assemblies

    (e.g., in an ASP.net MVC page the Controller may return an anonymous type as a model and the View may try to use it => blows up with exactly that error)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a specialized list that holds items of type IThing : public class
I have a class Team that holds a generic list: [DataContract(Name = TeamDTO, IsReference
Suppose I have two lists that holds the list of source file names and
I have an object that holds an object that is definded as IEnumerable, i.e.
I have a list of objects representing widgets. Each widget object has a manufactured
I have a method that I want to use to filter a listview. I
I have one List of objects that looks somthing like this class Item {
I have a list that looks like (A (B (C D)) (E (F))) which
I have a List that contains items, for example: 1) https:\\10.12.23\\ 2) https:\\12.23.12.25\\ 3)
I have one list that I want to take a slice of, reverse that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.