Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into 2017-2018
  • Loading branch information
malvoria committed Oct 5, 2018
2 parents ca6847b + 20412e2 commit e330952
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions Lectures/Lecture3/practice.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -297,28 +297,20 @@
"\n",
"#### Server\n",
"\n",
"To implement the server we need to make a _webapi_ project (`dotnet new webapi`). Once created, add to it the design package (`dotnet add package Microsoft.EntityFrameworkCore.Design`), and the sqlite package (`dotnet add package Microsoft.EntityFrameworkCore.Sqlite`), and by hand add a reference to the _EntityFrameworkCore_ in the projects' settings file (the one that ends in *.csproj).\n",
"To implement the server we can reuse the _webapi_ project we created in the previous practicum, making only some small changes. First of all, in the projects' settings file (the one that ends in *.csproj) remove the package reference to Json.\n",
"\n",
"\n",
"In the end the project settings file should look like this:\n",
"\n",
"<img src=\"4.JPG\">\n",
"<img src=\"4b.JPG\">\n",
"\n",
"Once created, make a folder _Models_ and add to it the models from the previous practicums. You need to change for this implementaiton the constructor of the context. It should eventually look like the following (in this example we use the 1<Movie>-N<Actors> example):\n",
"\n",
"In the MoviesController file add the following `using`:\n",
"\n",
"<img src=\"5.JPG\">\n",
"\n",
"Modify the Startup.cs file to connect our model to the controller.\n",
"\n",
"<img src=\"6.JPG\">\n",
"\n",
"\n",
"In the _Controllers_ folder add a MovieController.cs file. In this file we will configure the controller, which will take care of providing our movies and actors to the client.\n",
"\n",
"In the just made MovieController file add the folowing usings:\n",
"\n",
"<img src=\"7.JPG\">\n",
"- `using System.Net.Http;`\n",
"- `using System.Text;`\n",
"- `using System.Linq.Expressions;`\n",
"- `using Newtonsoft.Json;`\n",
"\n",
"Copy the _Filter_ class from the clients' code. We need this class because the deserializer in our server needs to know how to build-back the seriealized predicate. \n",
"\n",
Expand Down

0 comments on commit e330952

Please sign in to comment.