PhilBroderick / SportBoard

0 stars 0 forks source link

Pull data from API #21

Open PhilBroderick opened 5 years ago

PhilBroderick commented 5 years ago

It would probably be more beneficial in terms of performance to pull from an API for feed/post/comment data instead of through the MVC application.

PhilBroderick commented 5 years ago

This probably needs a bit of restructure of the project. I think the way it should go if I am going to use API to pull from the db is to go MVC(Presentation Layer) > Web API Controller> Data Access Repository(DAL)>ORM(EF)>Database. Currently the MVC talks directly to the DAL, but I think this would be a good project to undertake to abstract the MVC from the domain logic.

PhilBroderick commented 5 years ago

Two good articles

PhilBroderick commented 5 years ago

PR #32 adding more API methods - could add a custom route constraint on the Post by feed to check if the feed exists before hitting the endpoint.

PhilBroderick commented 5 years ago

On second thoughts, this might not be the best method to pull data back. Maybe in the MVC was in a different solution, but for this case probably best to keep it as it is and just keep the abstraction with the repository pattern. However I will flesh out the API as I could use it for my personal blog site to showcase some of the data and show my experience with Web API.