Skip to content

Dapper is a micro orm tool for .Net ado providers. The purpose of this library is to provide a tool that can be used in an easy and generic structure.

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt
Notifications You must be signed in to change notification settings

ferhatcandas/TStack.Dapper

Repository files navigation

Overview

Dapper is a micro orm tool for .Net ado providers. The purpose of this library is to provide a tool that can be used in an easy and generic structure.

Covarage

Include providers

  • SQLite
  • SQL CE
  • Firebird
  • Oracle
  • MySQL
  • PostgreSQL
  • SQL Server

Installation

Nuget Package

Package Manager

Install-Package TStack.Dapper -Version 1.0.0

.NET CLI

dotnet add package TStack.Dapper --version 1.0.0

PackageReference

<PackageReference Include="TStack.Dapper" Version="1.0.0" />

Paket CLI

paket add TStack.Dapper --version 1.0.0

Usage

To use database classes must be inherited from the "IDapperEntity" class before

    [TableName("Employee")] //TableName mapping
    public class Employee : IDapperEntity<int>
    {
        [Primary]//primary key
        public int Id { get; set; }
        public string Name { get; set; }
        public string Surname { get; set; }
        [Excluded]//excluded field not updating on insert or update 
        public string Email { get; set; }
        public DateTime BirthDate { get; set; }
        public double Salary { get; set; }
    }

For connection class

public class TestConnection : DapperConnection
{
	public TestConnection() : base(@"Server=.\SQLEXPRESS;Database=TESTDB;Trusted_Connection=True;", 30)
	{
	}
}

For repository

public class EmployeeRepository : DapperRepository<Employee, int, TestConnection>
{
}

That's it, now repository access to usable methods.

Author

Ferhat Candaş - Software Developer

About

Dapper is a micro orm tool for .Net ado providers. The purpose of this library is to provide a tool that can be used in an easy and generic structure.

Topics

Resources

License

MIT, MIT licenses found

Licenses found

MIT
LICENSE
MIT
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages