Contents tagged with dotnet core

  • Creating and Running Tests

    Building out the test project NOTE: the initial test project should have been created as an xUnit project. Towards that end I have added the command: yo aspnet xunit Pubs.Data.Test --version-current to the yoCommands.txt file and run it to use that as the test project. To create tests we will need to open up the Pubs.Data.Test project, then either delete the Class1.cs file, then add a new class named StoresTest, or else rename the Class1 class to StoresTest. Next open up the csproj file and add the following lines to dependencies, either manually or by using the NuGet Package Manager extension of VS Code: "Pubs.Data": "1.0.0-*"”Microsoft.EntityFrameworkCore”: “1.1.0”,"Microsoft.Extensions. … more

  • Setting Up the Projects for DotNet Core Web Api – Revisited

    Before creating any projects we will create a new branch in git locally, then push it up to github.com. The following lines of code will accomplish this:

    git checkout -b Setup_Projectsgit push origin Setup_Projects

    After this the local and remote repositories will both have a branch named Setup_Projects.

    Create Projects

    Now we are ready to create the projects that will comprise our solution. From a high level view this is what it will all look like if opened in Visual Studio:

    One thing that might jump out at you is that there is a seemingly superfluous console application. I tend to include such a project to test various thing as I develop. I find it very useful in terms of playing … more

  • DotNet Core and Web Api's

    Since the dotnet core and Web Api frameworks are the new hot things I decided I would get up to speed with them by building a reference application utilizing both technologies. In the process I will document the required steps in the hope that it will serve someone else as a good starting point and provide a good reference point bringing together all the required pieces to tackle the basics. The data that will be served is from that much maligned, but invaluable, database called pubs. The reason for this is the simplicity.

    This application will be as loosely coupled as I can possibly do. For example the Entity Framework (EF) will have its own project, as will the repository, web api, plus … more