{"id":26426195,"url":"https://github.com/pandaloupe/qsmapper","last_synced_at":"2026-01-25T14:31:47.628Z","repository":{"id":44922085,"uuid":"195430610","full_name":"pandaloupe/QsMapper","owner":"pandaloupe","description":"Conventional .Net SQL entity mapping framework.","archived":false,"fork":false,"pushed_at":"2025-05-06T18:17:02.000Z","size":300,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-11-14T13:03:11.523Z","etag":null,"topics":["csharp","dotnet","mapping-tools","orm","sql-server"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pandaloupe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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}},"created_at":"2019-07-05T15:22:55.000Z","updated_at":"2025-05-06T18:17:06.000Z","dependencies_parsed_at":"2024-01-19T15:55:51.473Z","dependency_job_id":"d9c2ed35-bea3-4b62-9ec3-ef37301b2963","html_url":"https://github.com/pandaloupe/QsMapper","commit_stats":{"total_commits":88,"total_committers":2,"mean_commits":44.0,"dds":"0.34090909090909094","last_synced_commit":"3993d2588214a556445b20993ec5e07bfe6a1d9d"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/pandaloupe/QsMapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaloupe%2FQsMapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaloupe%2FQsMapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaloupe%2FQsMapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaloupe%2FQsMapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pandaloupe","download_url":"https://codeload.github.com/pandaloupe/QsMapper/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pandaloupe%2FQsMapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28754204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: 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","dotnet","mapping-tools","orm","sql-server"],"created_at":"2025-03-18T03:22:45.971Z","updated_at":"2026-01-25T14:31:47.611Z","avatar_url":"https://github.com/pandaloupe.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# QsMapper\nConventional .Net SQL entity mapping framework.\n\nQsMapper is an easy to use zero configuration mapping framework using simple naming conventions to map sql based data into .Net objects and vice versa.\n\nThe framework provides a Linq-like fluent syntax for database operations on (MS)SQL Server databases.\n\n```csharp\nvar result = dao.Query\u003cCustomer\u003e()  \n   .Where(x =\u003e x.Field(\"FirstName\").IsEqualTo(\"John\"))  \n   .And(x =\u003e x.Field(\"LastName\").IsLike(\"Do%\"))  \n   .OrderBy(\"LastName\")  \n   .ThenBy(\"FirstName\")  \n   .ToList();\n```\n\nA basic dao implementation for MSSQL databases is provided with the project. \n\nImplementations for other relational database management systems may be developed based on the framework's interface definitions.\n\n# Conventions\n\n## Table and field names\n\nBy default QsMapper makes use of sql database schemes.\n\n```tsql\ncreate database QsSamples\ngo \n\nuse QsSamples\ngo\n\ncreate schema Contacts\ngo\n    \ncreate table Contacts.Customers\n(\n   Id int not null identity(1, 1),\n   Salutation nvarchar(20),\n   FirstName nvarchar(50),\n   LastName nvarchar(50),\n   Name as trim(FirstName + ' ' + LastName),\n   Birthday datetime,\n   constraint pk_contacts_customers primary key (Id)\n)\ngo\n```\n\nThe corresponding .Net Class should reside in a folder/namespace named **Contacts** and the class name itself would be **Customer**.\n\nAs you might have noticed the table name is the plural form of the class name. For conventions regarding exceptions please refer to [doc/Conventions.md](doc/Conventions.md).\n\nProperty names are mapped by the convention of identical names (case sensitive).\n\n```csharp\nusing Net.Arqsoft.QsMapper.Model; \n    \nnamespace Net.Arqsoft.QsMapper.Examples.Model.Contacts\n{\n   public class Customer : IntegerBasedEntity\n   {\n      // Id and Name are already declared in IntegerBasedEntity class\n      public string Salutation { get; set; }\n      public string FirstName { get; set; }\n      public string LastName { get; set; }\n      public DateTime? Birthday { get; set; } // may be null, so ? is recommended but optional\n   }\n}\n```\n\nPlease refer to [doc/Conventions.md](doc/Conventions.md) for more information on the framework's naming conventions.\n\n\n# Setup\n\nThe contained IGenericDao implementation may be constructed using a connection string like so.\n\n```csharp\nvar dao = new GenericDao(@\"Data Source=.\\SQLEXPRESS; Initial Catalog=QsSamples;Integrated Security=True\");\n```\n\nPlease refer to **GenericDao.md** (TODO) for more information.\n\n# Basic operations\n\n## Creating and updating objects\n\n```csharp\n//create\nvar customer = new Customer\n{\n   Salutation = \"Mr\",\n   FirstName = \"John\",\n   LastName = \"Doe\"\n};\n   \ndao.Save(customer);\n    \n// Id will be updated during save so it can be requested immediately after\n// (assuming the Id column is declared as identity)\nvar generatedId = customer.Id;\n   \n// update\ncustomer.Birthday = new DateTime(1985, 10, 3);\n    \ndao.Save(customer);\n```\n    \n## Retrieving single objects by id\n\n```csharp\nvar customer = dao.Get\u003cCustomer\u003e(1);\n```\n\n## Deleting objects\n\n```csharp\n// by id\ndao.Delete\u003cCustomer\u003e(1);\n\t\n// by object\ndao.Delete(customer);\n```\n\n## Querying objects\n\n```csharp\n// retrieve all records\nvar allCustomers = dao.Query\u003cCustomer\u003e().ToList();\n\n// query data using conditions\nvar customers = dao.Query\u003cCustomer\u003e()\n   .Where(x =\u003e x.Field(\"Salutation\").IsEqualTo(\"Mr\")\n   .OrderBy(\"Name\")\n   .ToList();\n```\n\nPlease refer to [doc/QueryBuilder.md](doc/QueryBuilder.md) for more information.\n\n## Calling stored procedures\n\n```csharp\n// without return value\ndao.Execute(\"Booking.CreateSchedule\")\n  .WithParameter(\"Year\", 2020)\n  .AsVoid();\n      \n// with return value\ndao.Execute(\"Sales.CreateJournal\")\n  .WithParameter(\"UserName\", CurrentUser.Name)\n  .WithParameter(\"Time\", DateTime.Now)\n  .AsFunction();\n\n// with data output\ndao.Execute(\"Contacts.RetrieveCustomersByCityCode\")\n    .WithParameter(\"FirstCityCode\", \"20000\")\n    .WithParameter(\"LastCityCode\", \"29999\")\n    .AsListOf\u003cCustomer\u003e();\n```\n\nPlease refer to **CommandBuilder.md** (TODO) for more information.\n\n# Mapping declarations\n\nData relations and behaviour of the framework may be defined in a custom catalog definition.\n\n```csharp\npublic class SampleCatalog : Catalog\n{\n   public SampleCatalog() \n   {\n      RegisterMap\u003cQuote\u003e()\n         .QueryWithView(\"Sales.QuotesQuery\")\n\t .WithMany\u003cQuoteItem\u003e();\n   }\n}\n```\n\nPlease refer to **Catalog.md** (TODO) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandaloupe%2Fqsmapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpandaloupe%2Fqsmapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpandaloupe%2Fqsmapper/lists"}