{"id":22775102,"url":"https://github.com/g-s-c-code/libraryapi","last_synced_at":"2025-03-30T13:14:27.133Z","repository":{"id":215646316,"uuid":"739465159","full_name":"g-s-c-code/LibraryAPI","owner":"g-s-c-code","description":"RESTful API built with ASP.NET Core 8, supporting both Entity Framework Core and Dapper for data access, with SQL Server as the database. Features .NET Aspire orchestration for telemetry capture, enabling performance benchmarking between EF Core and Dapper. Swagger is included for API endpoint documentation and testing.","archived":false,"fork":false,"pushed_at":"2025-01-02T12:31:00.000Z","size":194,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-05T14:48:17.352Z","etag":null,"topics":["asp-net-core","aspire","aspire-dashboard","dapper","efcore","entity-framework-core","rest-api","restful-api","sql"],"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/g-s-c-code.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":"2024-01-05T16:23:14.000Z","updated_at":"2025-01-02T12:31:04.000Z","dependencies_parsed_at":"2024-01-05T17:27:08.630Z","dependency_job_id":"38d0d961-6e2a-4271-8565-69f2bc8d663c","html_url":"https://github.com/g-s-c-code/LibraryAPI","commit_stats":null,"previous_names":["g-s-c-code/libraryapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-s-c-code%2FLibraryAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-s-c-code%2FLibraryAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-s-c-code%2FLibraryAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g-s-c-code%2FLibraryAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g-s-c-code","download_url":"https://codeload.github.com/g-s-c-code/LibraryAPI/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246320199,"owners_count":20758410,"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":["asp-net-core","aspire","aspire-dashboard","dapper","efcore","entity-framework-core","rest-api","restful-api","sql"],"created_at":"2024-12-11T18:25:38.616Z","updated_at":"2025-03-30T13:14:27.108Z","avatar_url":"https://github.com/g-s-c-code.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LibraryAPI\n\nThis repository contains a solution demonstrating two approaches for building a RESTful API: one using Entity Framework Core and the other using Dapper. Both projects are fully functional, interchangeable, and configured with Swagger for API documentation and testing. Each project functions independently, allowing users to select based on preference or requirements. Both projects also utilize .NET Aspire for orchestration and telemetry capture, enabling performance benchmarking between the two implementations.\n\n## Projects\n\n### 1. Entity Framework Core Based API\n\nThis project demonstrates a RESTful API built with ASP.NET Core 8, Entity Framework Core and SQL Server. Swagger is utilized to document and test the API endpoints.\n\n#### Architecture\n- **Presentation**: Interact with the API using Swagger UI.\n- **Business Logic**: Handles operations such as creating a book entry and managing loans.\n- **Data Access**: Uses Entity Framework Core for data management.\n\n#### Features\n- **CRUD Operations**: Manage books, borrowers, and loans.\n- **Data Validation**: Ensures data integrity.\n- **Swagger Documentation**: Provides an easy way to understand and test API endpoints.\n\n#### Notes\n- You will need to manually configure a database connection, as the database used during the build is not connected due to hosting costs.\n\n| **Entity Framework Core** |\n|:-------------------------:|\n| \u003ca target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/g-s-c-code/LibraryAPI/main/Images/efcore.png\" width=\"400px\" /\u003e |\n\n\u003cbr\u003e\n\n### 2. Dapper Based API\n\nThis project demonstrates a RESTful API built with ASP.NET Core 8, Dapper and SQL Server. It serves as a lightweight alternative to the EF Core-based API, providing a streamlined approach to data access.\n\n#### Architecture\n- **Presentation**: Interact with the API using Swagger UI.\n- **Business Logic**: Similar operations as the EF Core-based API but implemented with Dapper.\n- **Data Access**: Uses Dapper for data management.\n\n#### Features\n- **CRUD Operations**: Manage books, borrowers, and loans.\n- **Data Validation**: Ensures data integrity.\n- **Swagger Documentation**: Provides an easy way to understand and test API endpoints.\n\n#### Notes\n- As with the EF Core-based API, you will need to manually configure a database connection due to the absence of a connected database.\n\n| **Dapper** |\n|:-------------------------:|\n| \u003ca target=\"_blank\" rel=\"noreferrer\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/g-s-c-code/LibraryAPI/main/Images/dapper.png\" width=\"400px\" /\u003e |\n\n\u003cbr\u003e\n\n## Usage\n\nYou can choose to run either project depending on your needs:\n\n1. **Entity Framework Core Based API**: Navigate to the `LibraryAPI.EFCore` project and set it as the startup project.\n2. **Dapper Based API**: Navigate to the `LibraryAPI.Dapper` project and set it as the startup project.\n\nBoth projects are fully configured to run standalone and include Swagger for API documentation and testing. Ensure you have the necessary database configurations set up in the `appsettings.json` file for the chosen project.\n\n## Getting Started\n\n1. Clone the repository:\n    ```bash\n    git clone https://github.com/g-s-c-code/LibraryAPI.git\n    ```\n\n2. Navigate to the desired project directory:\n    ```bash\n    cd LibraryAPI/EFCore\n    # or\n    cd LibraryAPI/Dapper\n    ```\n\n3. Install the required dependencies:\n    ```bash\n    dotnet restore\n    ```\n\n4. Create and configure `appsettings.json` with your database connection (nested in 'root').\n\n5. Run the project:\n    ```bash\n    dotnet run\n    ```\n\n6. Access Swagger UI at `http://localhost:5000/swagger` (port may vary).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-s-c-code%2Flibraryapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg-s-c-code%2Flibraryapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg-s-c-code%2Flibraryapi/lists"}