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

  • Home
  • SEARCH
  • 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 7507183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:26:11+00:00 2026-05-29T22:26:11+00:00

Recently I have been exploring using the fancy new dynamic keyword introduced in C#

  • 0

Recently I have been exploring using the fancy new dynamic keyword introduced in C# 4.0 (DynamicObject, ExpandoObject etc..)

Now I can identify several uses (and several pitfalls) for the new introduction, but for the purpose of my project, and for this question – I am looking into cleaning up my late-bound string-based indexed collections to make them more safe.

So, before dynamics I had:

Car car1 = CARWarehouse1["Honda"];

And WITH dynamics I can now do (where CARWarehouse1 now extends the DynamicObjects base)

Car car1 = CARWarehouse1.Honda

This is all well and good, and from a quick glance it looks like I have achieved what I wanted.. but have I?
Because lets face it, for either method at compile time should I have mistyped my referenced car type, the compiler won’t have a problem, but I will run into issues at runtime.

Therefore, what I really need is compile time property checking, and Intellisense support. So – can I do it?

I know that there are libraries out there such as Moq that have this capability, and Resharper gives some sort of support within intellisense, but I’m looking for a more rounded solution.

Any ideas, big, small, easy or complex are welcome.

  • 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-29T22:26:13+00:00Added an answer on May 29, 2026 at 10:26 pm

    Nope, no such thing for dynamic types.

    Basically the compiler just skips all checks on variables marked as dynamic because there is no way to check anything. Properties on dynamic objects may be created at runtime, so the code can’t be checked at compile time for accuracy.

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

Sidebar

Related Questions

Hi I have been recently exploring some of the Javascript mobile frameworks that can
I have been practicing TDD in C# for several years now and recently have
Recently I have been studying recursion; how to write it, analyze it, etc. I
I was listening to a podcast recently (may have been SO - can't remember)
I have recently been exploring the Tornado web framework to serve a lot of
I'm a longtime python developer and recently have been introduced to Prolog. I love
Recently I have been using thrust a lot. I have noticed that in order
Until recently I have been using cairngorm as a framework for flex. However, in
Recently I've been exploring Backbone , and they do encourage using a template engine.
Recently I have been reading more and more about people using custom attributes in

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.