How to bind a model to a dynamically created class nancyfx

后端 未结 1 1581
说谎
说谎 2021-01-28 09:51

first of all thanks for anyone who\'s willing to have a look at my problem. I\'m pretty new with Nancyfx and I\'m having issues with trying to bind a JSON payload to a dynamical

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-28 10:20

    It sounds like you may be better off using a Dynamic type:

    https://gist.github.com/thecodejunkie/5521941

    TheCodeJunkie has a custom model binder for Dynamic. You should be able to use this to do:

    dynamic model = this.Bind();

    0 讨论(0)
提交回复
热议问题