GithubHelp home page GithubHelp logo

munroraymaker / dapper-samples Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yorek/dapper-samples

0.0 1.0 0.0 1.23 MB

Tutorial samples that shows how to use Dapper .NET

Home Page: https://medium.com/dapper-net

License: Apache License 2.0

C# 87.40% TSQL 12.60%

dapper-samples's Introduction

Dapper .NET Samples

Samples that shows how to use Dapper .NET.

These are the samples mentioned in the Dapper .Net publication on Medium:

https://medium.com/dapper-net

Work is still in progress, so come back often to check out new articles and samples. My aim to to publish one article per week, until all feature of Dapper are covered.

Here's the list of samples related to articles published so far:

  1. Getting Started with Dapper .NET
  2. Multiple Executions
  3. Multiple Resultsets
  4. Multiple Mapping
  5. SQL Server Features
  6. Custom Mapping
  7. Custom Handling
  8. One-To-Many Relationships
  9. Complex Custom Handling

Please note that the "One-To-Many Relatioships" and "Complex Custom Handling" points to the same articles since both topics are discussed there as they are strictly related to each other.

Running The Samples

To run the "Basic Samples", related to the first article "Getting Started with Dapper .NET", just run

dotnet run -f net48

from

Dapper.Samples.Basics

folder. To run advanced samples you have to move into

Dapper.Samples.Advanced

and then from here you can just run

dotnet run -f net48

to run ALL samples or

dotnet run -f net48 "Sample Name"

to run that specific sample. Eg:

dotnet run -f net48 "Multiple Executions"

to run only the "Multiple Execution" sample.

To have a list of all advanced samples available run:

dotnet run -f net48 -help

Notes

.NET Version

Samples are done using .NET Core 3.0 and .NET Framework 4.8: make sure you have them installed it on your machine.

The project supports multiple targets:

  • net48
  • netcoreapp3.0

To execute the application targeting one specifc framework, just use the -f option when running the console app:

dotnet run -f net48

more info on the -f option here:

dotnet run

If you are looking for samples supporting older version, take a look at the previous releases as they support also:

  • .NET Framework 4.5.2
  • .NET Core 2.0
  • Dapper 1.50

SQL Server

Samples also use SQL Server as database server. If you don't have a Windows machine, you can use the Docker version: SQL Server 2017. SQL Server database file is attached automatically using the LocalDB/MSSQLServer instance. If you prefer to use a non-local instance, make sure you change the connection string accordingly, and attach the database file to your instance.

dapper-samples's People

Contributors

munroraymaker avatar yorek avatar

Watchers

 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.