Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 578 Bytes

README.md

File metadata and controls

18 lines (14 loc) · 578 Bytes

DynamicAnonymousType NuGet version

Dynamic creating Anonymous (similar) Types at program runtime.

using DynamicAnonymousType;


Type type = DynamicFactory.CreateType(
    ("Id", typeof(int)),
    ("Name", typeof(string)),
    ("Date", typeof(DateTime?)));

dynamic instance = type.CreateInstance(
    ("Id", 1),
    ("Name", "Text1"),
    ("Date", DateTime.Now));

Program.cs