Unable To populate view or view model Updaed

微笑、不失礼 提交于 2019-12-02 12:34:50

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!