{"id":28909192,"url":"https://github.com/tekyaygilfethi/dotnetdapperlinqscaffold","last_synced_at":"2026-04-22T21:33:48.342Z","repository":{"id":115972194,"uuid":"548583424","full_name":"TekyaygilFethi/DotNetDapperLinqScaffold","owner":"TekyaygilFethi","description":"This project is a scaffold for Dapper Linq via using PostgreSQL","archived":false,"fork":false,"pushed_at":"2022-10-09T22:32:13.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-01T03:43:06.821Z","etag":null,"topics":["csharp","dapper","dotnet6","linq","postgresql"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TekyaygilFethi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-09T21:28:12.000Z","updated_at":"2022-10-09T22:55:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0ccb2d2-32aa-47d8-aa5f-75280d2524b7","html_url":"https://github.com/TekyaygilFethi/DotNetDapperLinqScaffold","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TekyaygilFethi/DotNetDapperLinqScaffold","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TekyaygilFethi%2FDotNetDapperLinqScaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TekyaygilFethi%2FDotNetDapperLinqScaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TekyaygilFethi%2FDotNetDapperLinqScaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TekyaygilFethi%2FDotNetDapperLinqScaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TekyaygilFethi","download_url":"https://codeload.github.com/TekyaygilFethi/DotNetDapperLinqScaffold/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TekyaygilFethi%2FDotNetDapperLinqScaffold/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32156602,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T17:06:48.269Z","status":"ssl_error","status_checked_at":"2026-04-22T17:06:19.037Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["csharp","dapper","dotnet6","linq","postgresql"],"created_at":"2025-06-21T17:08:02.789Z","updated_at":"2026-04-22T21:33:48.315Z","avatar_url":"https://github.com/TekyaygilFethi.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# .NET 6 Dapper Linq with PostgreSQL Scaffold\n\nThis project is a scaffold for Dapper Linq usage via using PostgreSQL database for .NET 6. With the help of this project, you can use Dapper Linq in your projects very easily. Also you can edit or add dialects to fit this project to any other databases such as MySQL, MSSQL or Oracle Db.\n\nYou can access Dapper.Linq Github Page through here: https://github.com/tmsmith/Dapper-Extensions\n\nDespite this repository is about Dapper scaffold, Entity Framework Code First is being used for creating a new database on PostgreSQL.\n\n# Tech Stack\n\n- **.NET 6.0 Web API** as Framework with **C#**\n- **Entity Framework Code First Approach** to Create Database Tables\n- **Dapper** to Perform Database Operations\n- **Postgre SQL** for database\n\n# Components\n\nThis scaffold is built by several components.\n\n## Custom PostgreSQL Dialect\nDialects can be thought as set of rules of the phases of executing database operations. Getting table or column names can be given as an example to these rules. By default, PostgreSQL dialect converts all table and column names to lowercase:\n\n```csharp\npublic override string GetColumnName(string prefix, string columnName, string alias)\n{\n    return base.GetColumnName(prefix, columnName, alias).ToLower();\n}\n\npublic override string GetTableName(string schemaName, string tableName, string alias)\n{\n    return base.GetTableName(schemaName, tableName, alias).ToLower();\n}\n```\n\nWhile sustaining the other parts of original dialect class, we have deleted the ToLower parts to prevent all table and column names to be converted to lowercase in out CustomPostgreSqlDialect class:\n```csharp\npublic override string GetColumnName(string prefix, string columnName, string alias)\n{\n    return base.GetColumnName(prefix, columnName, alias);\n}\n\npublic override string GetTableName(string schemaName, string tableName, string alias)\n{\n    return base.GetTableName(schemaName, tableName, alias);\n}\n```\n\n## Custom Table Mapper\nCustom Table Mapper is responsible from mapping the relevant table names. For instance, if you have a table named 'HeroTable' and POCO class named 'Hero', this mapper should map your sent queries with the type of 'Hero' as 'HeroTable' in your queries:\n```csharp\npublic class CustomTableMapper\u003cT\u003e : AutoClassMapper\u003cT\u003e where T : class\n    {\n        public override void Table(string tableName)\n        {\n            base.Table(tableName + \"Table\");\n        }\n    }\n```\n\n## Dapper Configuration\nIn Program.cs, other components are being used while configuring Dapper for generic usage.\n\n```csharp\nDapperConfiguration.Use()\n    .UseClassMapper(typeof(CustomTableMapper\u003c\u003e))\n    .UseContainer\u003cContainerForWindsor\u003e(c =\u003e c.UseExisting(new Castle.Windsor.WindsorContainer()))\n    .UseSqlDialect(new CustomPostgreSqlDialect())\n    .Build();\n```\n\n# Configuring Database\n\nYou can set your own Postgre SQL Connection String on appsettings.json file on API project as shown below:\n\n```json\n\"ConnectionStrings\": {\n    \"PostgreSQLConnString\": \"Server={MY_SERVER};Port={MY_PORT};Database={MY_DATABASE};User ID={MY_USER_ID};Password={MY_PASSWORD}\"\n  }\n```\n## Using Default Data\n\nOnce you set your own connection string, you can create default tables and data for the project. To achieve that, open Package Manager Console and type:\n\n```bash\n$ Update-Database -Verbose\n```\n\nThis will apply existing migrations to the database.\n\n## Altering or Creating Tables\nTo add a new table, you must create new POCO classes for each table which is implemented from POCOEntity. You must create a new DbSet for each freshly added POCO Object in corresponding DbContext class. (For example Hero DbSet is in DapperLinqScaffoldDbContext.Hero class). After adding new tables as DbSet to DbContext class, open Package Manager Console, type and execute:\n```bash\n$ Add-Migration MyNewMigration\n```\nAfter the statement has executed, type and execute:\n```bash\n$ Update-Database -Verbose\n```\n\nAnd your database will be updated!\n\n# Run\n\nClone the project\n\n```bash\n  $ git clone https://github.com/TekyaygilFethi/DapperLinqScaffold.git\n```\nGo to project root directory and run the project:\n\n```bash\n  $ dotnet run\n```\n\nThen you should be able to access site.\n\n## Authors\n\n- [@TekyaygilFethi](https://www.github.com/TekyaygilFethi)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftekyaygilfethi%2Fdotnetdapperlinqscaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftekyaygilfethi%2Fdotnetdapperlinqscaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftekyaygilfethi%2Fdotnetdapperlinqscaffold/lists"}