Giter VIP home page Giter VIP logo

dapperseries's Introduction

DapperSeries

Sample code for the Dapper Series of blog posts:

  1. Loading an Object from SQL Server using Dapper

The sample project for this series of blog posts is an ASP.NET Core project containing api controllers. To test the project you will issue GET and POST to the api.

Requirements

.NET Core SDK v2.1.4 or newer A SQL Server database (Localdb or any modern version of SQL Server will work fine)

Creating a new database

The sample can be used to create a new database with some sample data. The default setting is to use localdb. If you do not have localdb installed, change the connection string in applicationSettings.json to point to an instance of SQL Server on your machine.

From the src\DapperSeries folder, build and run the app.

dotnet build
dotnet run

Using a tool like Postman, issue a post request to localhost:5000\api\db\init

Creating the database

A database containing tables and sample data should be created. If everything worked as expected, you will receive a 200 OK result. If not, you should get some HTML that will have an error buried in it somewhere.

Testing Queries

To execute the code for various API controllers, send get requests and see the results. For example, to query for the Aircraft with ID 42, send a get request to localhost:5000\api\aircraft\42\ Query for an aircraft

dapperseries's People

Contributors

dpaquette avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.