{"id":20923905,"url":"https://github.com/logofx/samples.migrations.repository-uow","last_synced_at":"2025-09-09T23:13:29.100Z","repository":{"id":146796302,"uuid":"387230776","full_name":"LogoFX/Samples.Migrations.Repository-UoW","owner":"LogoFX","description":"The sample shows, how to migrate from ADO.NET to Entity Framework","archived":false,"fork":false,"pushed_at":"2021-08-10T13:33:43.000Z","size":1295,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T00:43:56.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/LogoFX.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}},"created_at":"2021-07-18T17:19:53.000Z","updated_at":"2021-08-12T11:07:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"17b48ee5-d573-47d1-b7d5-73dee2504555","html_url":"https://github.com/LogoFX/Samples.Migrations.Repository-UoW","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LogoFX/Samples.Migrations.Repository-UoW","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogoFX%2FSamples.Migrations.Repository-UoW","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogoFX%2FSamples.Migrations.Repository-UoW/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogoFX%2FSamples.Migrations.Repository-UoW/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogoFX%2FSamples.Migrations.Repository-UoW/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LogoFX","download_url":"https://codeload.github.com/LogoFX/Samples.Migrations.Repository-UoW/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LogoFX%2FSamples.Migrations.Repository-UoW/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264871886,"owners_count":23676539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-18T20:18:23.340Z","updated_at":"2025-07-11T18:36:01.213Z","avatar_url":"https://github.com/LogoFX.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Sample: How to migrate from ADO.NET to Entity Framework using the Repository and Unit of Work design patterns\n\nThe step by step sample shows how to create a minimalistic ASP.NET Web API 2 Web API server application using following best practices:\n* The Modularity — To build the solution with REALLY independent modules (aka, assemblies, projects)\n* The Automation — To automate development tasks, like as a builds, code generation, etc.\n* The Standards — To use all the power of OpenAPI standards, automatic code generation for service facades and clients (Single Source of Truth)\n* The Migration - To build the data access layer such as it could allow migration from ADO.NET to EF (it's necessary for future migration from .NET Framework to .NET 5.0) as easy as possible.\n* The bonus — The GraphQL endpoint project built on top of .NET. 5.0 framework, but using same infrastructures developed with .NET Framework 4.7.2.\n\n## The Source Code\n\nThe source code contains four subfolders named as ``part(n)``. Each of the parts are just steps on the solution genesis roadmap.\n\n### Part 1\n* The API project uses different modules to access to database due selected solution build configuration.\n* The GraphQL project uses direct link to AdoDotNet module project and works only ```AdoDotNet``` solution build configuration.\n* Entities, models and data service are configured to work only with one kind of data objects: ```Court```.\n\n### Part 2\n* Both API and GraphQL projects use different modules to access to database due selected solution build configuration.\n* Entities, models and data service are configured to work only with one kind of data objects: ```Court```.\n\n### Part 3\n* Both API and GraphQL projects use different modules to access to database due selected solution build configuration.\n* Entities, models and data service are configured to work with two kind of data objects: ```Court```, ```CourtLevel```.\n\n### Part 4\n* ```Court``` entity has nested property ```Level``` which linked to ```CourtLevels``` table via ```LevelId``` foreign key.\n\n## Prerequisites\n\n1. Microsoft .NET Framework v.4.7.2 or above;\n2. .NET Framework v.5.0 or above;\n3. NodeJs ≥v.14;\n4. Visual Studio 2019.\n\n## How to start\n1. Download, or clone, or fork the repository.\n1. Choose a step (```src/Part(n)```) folder to start to play with solution. We recommend to start from ```part3``` or ```part4```, and examine all the way from Part1 to Part(n) after.\n1. Run ```/devops/run-once.cmd```. It installs globally nswag package.\n1. Open the solution found in one of Part(n) folders in the Visual Studio 2019.\n1. Create database using ```Samples.Server.SampleDB``` project.\n   1. Build the database project.\n   1. Launch 'publish' command.   \n   ![Publish Settings](/public/img/image01.png)   \n   1. Choose connection.   \n   ![Connection Settings](/public/img/image02.png)  \n   3. In field \"Database Name\" type new database name (i. e. SampleDatabase2).\n   4. Press \"OK\".\n   5. Press \"Publish\".\n   \n1. In solution properties dialog set multiply startup projects: ```Samples.Server.Facade``` and ```Samples.Server.GraphQL.Facade```.\n1. Set connections string.\n   1. In root of the ```Samples.Server.Facade``` project edit ```WebConnectionString.config``` file. Set connection string named ```appEntities```.\n   1. In root of the ```Samples.Server.GraphQL.Facade``` project edit ```appsettings.json``` file. Set connection string named ```appEntities```\n1. Start projects configuration\n   1. In the ```Samples.Server.Facade``` project find and open for edit ```WebConnectionString.config``` file. Define the connection string named ```appEntities```. Open the project properties. Navigate to \"Web Settings\" and set \"Specific Page\" to open \"swagger\" page.   \n   ![Web Settings](/public/img/image03.png)\n   1. In the ```Samples.Server.GraphQL.Facade``` project find and open for edit ```appsettings.json``` file. Define the connection string named ```appEntities```.\n1. Choose ```DebugAdoNet``` or ```DebugEF``` from solution build configuration.\n1. Do \"Rebuild All\".\n1. Do \"start\".\n\n## Solution structure\n\nThe solution consists from infrastructures and applicative code. All of the infrastructure projects may be facilitated with additional things and published as packages (recommended). \n\nThe solution contains two entry-point projects:\n* Samples.Server.Facade -- API server with swagger;\n* Samples.Server.GraphQL.Facade -- GraphQL server;\n\n## Build Configurations\n\nIn order to use modularity over configuration approach the solution uses VS Build Configurations tool to build relevant modules only. We prepared two configurations as following:\n* ```DebugAdoNet``` — The ```Samples.Server.Data.Context.AdoDotNet``` module (project) will be compiled and used to provide access to database.\n* ```DebugEF``` — The ```Samples.Server.Data.Context.EntityFramework``` module (project) will be compiled and used to provide access to database.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogofx%2Fsamples.migrations.repository-uow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogofx%2Fsamples.migrations.repository-uow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogofx%2Fsamples.migrations.repository-uow/lists"}