我需要動態創建類對象。我嘗試使用動態關鍵字。如何動態創建類
dynamic dataTransferObject = new dtoClass();
dataTransferObject.Property1= "someValue";
dataTransferObject.Property2= "someOtherValue";
LogicLayer.Update(dataTransferObject);
我將解釋該對象在邏輯層內部執行進一步的操作。編譯器不喜歡我的語法,請指教!
dtoClass是否存在於編譯時或僅在運行時? –
該對象僅在運行時存在。 – AnxiousdeV