quasar / Quasar

Remote Administration Tool for Windows
MIT License
8.36k stars 2.38k forks source link

[Construct build exceptions] used some json parsing of dynamic types in my code and it didn't work properly #1207

Open AlphaCharry opened 11 months ago

AlphaCharry commented 11 months ago

Problem description

                dynamic[] configTable = JsonConvert.DeserializeObject<dynamic[]>(configTableJson);
                int count = configTable.Length;

                foreach (dynamic RowItem in configTable)
                {
                    bool isExist = ConfigHelper.checkBhinDataTable(RowItem.bh.Value);  .// erro <----happend
                    string ExecSQL = "";
                    if (isExist)
                    {
                        ExecSQL = ConfigHelper.getUpdateSQLBuilder(RowItem);
                    }
                    else
                    {
                        ExecSQL = ConfigHelper.getInsertSQLBuilder(RowItem);
                    }
              }

Hello man, I added a code like this in the client and he doesn't work properly, catch to error is checkBhinDataTable is not defined! But I run this statement alone and he works fine

bool isExist = ConfigHelper.checkBhinDataTable(RowItem.bh.Value);
rerutn isExist 

Proposal

Is there a problem with the compilation?

Additional context

No response

AlphaCharry commented 11 months ago

foreach ? Whether it is related to dynamic typing ?checkBhinDataTable getUpdateSQLBuilder getInsertSQLBuilder will say not found not define!