|
|
От: | Lazarus | |
| Дата: | 04.12.15 10:12 | ||
| Оценка: | |||
var anon = new { Date = DateTime.Now, Command = "c1" };
Test_OK(anon);
new Second().Test_BAD(anon);public void Test_OK(dynamic data)
{
MessageBox.Show("Type: " + data.GetType());
MessageBox.Show("Command: " + data.Command);
}An unhandled exception of type 'Microsoft.CSharp.RuntimeBinder.RuntimeBinderException' occurred in System.Core.dll
Additional information: "object" не содержит определения для "Command"