Probably the easiest way is to use DataBinder.Eval from System.Web.UI:
var foo = new Foo() { Bar = new Bar() { Value = "Value" } };
var value = DataBinder.Eval(foo, "Bar.Value");
More Related Contents:
- How can I evaluate a C# expression dynamically?
- Identify if a string is a number
- How to abort a Task like aborting a Thread (Thread.Abort method)?
- How To Represent 0.1 In Floating Point Arithmetic And Decimal
- ASP.NET MVC Binding to a dictionary
- Is it safe to check floating point values for equality to 0?
- Find text in string with C#
- Find a WPF element inside DataTemplate in the code-behind
- When to use abstract classes?
- Delegates: Predicate vs. Action vs. Func
- LEFT JOIN in LINQ to entities?
- Send SMTP email using System.Net.Mail via Exchange Online (Office 365)
- How do I use ASP.NET Identity 2.0 to allow a user to impersonate another user?
- What is the difference between .Equals and == [duplicate]
- How to elegantly deal with timezones
- How to avoid a System.Runtime.InteropServices.COMException?
- Problem Updating to .Net 6 – Encrypting String
- MVC: Where to put business logic? [closed]
- Overriding GetHashCode for mutable objects?
- GDI+ / C#: How to save an image as EMF?
- C# Regex: Checking for “a-z” and “A-Z”
- Simplest way to run three methods in parallel in C#
- ContextSwitchDeadlock Was Detected error in C#
- C# operator overload for `+=`?
- validate a dropdownlist in asp.net mvc
- Serialize/Deserialize dynamic property name using JSON.NET
- log4net: Configure to ignore messages from a specific class
- How to detect when laptop power cable has been disconnected?
- No service for type ‘Microsoft.AspNetCore.Identity.UserManager`1[Microsoft.AspNetCore.Identity.IdentityUser]’ has been registered
- SMTP Send is locking up my files – c#