Add temp movie data
Let us add some data to display
Creating temporary data
Ideally, we get data from some data store like database or service. For this discussion let us keep database or ORM specific details away and rather create a fake Context, which will serve as a data source for now. We can later replace it with a real data context!
ORMs use the term Context to denote an object which is an interface with the application code and the underlying database. Context objects do the heavy lifting for us and we can focus on the data itself.
Adding a fake context
Let us first create a folder called Data
at the root of the project and then create a class called FakeContext.cs
inside the data folder, as shown:
Replace the contents of FakeContext.cs class with this:
Let us see how to pass the data from controller to view next!
Last updated