Unable To populate view or view model Updaed

后端 未结 1 1237
梦谈多话
梦谈多话 2021-01-29 01:25

Hi I am following up on this question here and working through a proof of concept for a SPA using our Company database data from a series of examples / articles Using Web API 2

相关标签:
1条回答
  • 2021-01-29 01:32

    To help others.

    The problem was as I was adapting the work through to Database first approach and I had not correctly created my model file

    To help with debug on the running web app I posted a request to my Get API

    api/RequistionsForApprovals
    

    This returned a blank return, proving the problem was with my data reading not my knock out models and bindings. After reading up a bit more I thought I had not defined correctly the primary key of the EF model of my SQL view, therefore I needed to edit the edmx file as in the case here.

    However I could not find my edmx file in my solution. Therefore I went through the process of adding a new item, Data, then choosing ADO.net Entity Data model. This created the mappings to my model class and a context which I was able to use with my controller

    A bit of a simple mistake, but that is often the case when learning a new process!

    Hope it helps anyone else

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