{"id":25839836,"url":"https://github.com/itsyst/library-management-system","last_synced_at":"2025-03-01T04:35:16.955Z","repository":{"id":109509475,"uuid":"304579247","full_name":"itsyst/library-management-system","owner":"itsyst","description":"Migrate from ASP.NET Core 3.1 to 8.0 achieved by: Eric Van Dan Outenaar, and Khaled El Hamzi.","archived":false,"fork":false,"pushed_at":"2024-01-31T12:42:11.000Z","size":7758,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-31T13:47:23.459Z","etag":null,"topics":["asp-net-core","bootstrap5","clean-architecture","csharp","entity-framework-core","net7","razor-pages","sql"],"latest_commit_sha":null,"homepage":"https://library.elhamzi.com","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/itsyst.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-10-16T09:23:25.000Z","updated_at":"2024-01-25T15:17:04.000Z","dependencies_parsed_at":"2023-03-31T12:03:43.066Z","dependency_job_id":"4d7cdad4-7f58-4e61-bbca-fa0c269d9167","html_url":"https://github.com/itsyst/library-management-system","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsyst%2Flibrary-management-system","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsyst%2Flibrary-management-system/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsyst%2Flibrary-management-system/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsyst%2Flibrary-management-system/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsyst","download_url":"https://codeload.github.com/itsyst/library-management-system/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241317612,"owners_count":19943200,"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","bootstrap5","clean-architecture","csharp","entity-framework-core","net7","razor-pages","sql"],"created_at":"2025-03-01T04:35:16.374Z","updated_at":"2025-03-01T04:35:16.945Z","avatar_url":"https://github.com/itsyst.png","language":"C#","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/itsyst/khaled_elhamzi_portfolio\"\u003e\n    \u003cimg alt=\"logo\" src=\"https://res.cloudinary.com/dzltxlm9l/image/upload/v1601971370/logo_fd60ee4493.png\" width=\"90\"  /\u003e\n  \u003c/a\u003e\n  \u003cp\u003e Library-Management-System \u003c/p\u003e\n  \u003cp\u003eThis Project is an open-source project updated from Asp.Net 3.1 to .NET Core 8.\u003c/p\u003e\n\u003c/div\u003e\n \n## Give a Star! :star:\nIf you Like the project, please give a star ;)\n## How to use:\n- You will need the latest Visual Studio 2022 and the latest .NET Core 8.\n- The latest SDK and tools can be downloaded from https://dot.net/core.\nAlso you can run this Project in Visual Studio Code (Windows, Linux or MacOS).\nTo know more about how to setup your enviroment visit the [Microsoft .NET Download Guide](https://www.microsoft.com/net/download)\nBuild a complete e-commerce application ASP.NET Core  MVC  .NET 8\n\n## Layout\n \n\u003ca href=\"https://github.com/itsyst/Library-Management-System\"\u003e\n  \u003cimg alt=\"logo\" src=\"https://res.cloudinary.com/itsyst/image/upload/v1697232915/library_management_system_92e949e044_942a370012.webp\" width=\"500\"  /\u003e\n\u003c/a\u003e\n\n## Here is a quick check list you could follow to migrate your application from .Net 3.1 to .Net 6\n- Upgrade the reference in csproj files\n```\n// Old\n\u003cProject Sdk=\"Microsoft.NET.Sdk.Web\"\u003e\n  \u003cPropertyGroup\u003e\n    \u003cTargetFramework\u003enetcoreapp3.1\u003c/TargetFramework\u003e\n  \u003c/PropertyGroup\u003e\n\u003c/Project\u003e\n\n// New\n\u003cProject Sdk=\"Microsoft.NET.Sdk.Web\"\u003e\n  \u003cPropertyGroup\u003e\n\t  \u003cTargetFramework\u003enet6.0\u003c/TargetFramework\u003e\n    \u003cImplicitUsings\u003eenable\u003c/ImplicitUsings\u003e\n\t  \u003cNullable\u003eenable\u003c/Nullable\u003e\n  \u003c/PropertyGroup\u003e\n\u003c/Project\u003e\n````\n- Upgrade the packages\n\n````\n//Old\n  \u003cItemGroup\u003e\n    \u003cPackageReference Include=\"Microsoft.EntityFrameworkCore.SqlServer\" Version=\"3.1.2\" /\u003e\n    \u003cPackageReference Include=\"Microsoft.EntityFrameworkCore.Tools\" Version=\"3.1.2\"\u003e\n      \u003cPrivateAssets\u003eall\u003c/PrivateAssets\u003e\n      \u003cIncludeAssets\u003eruntime; build; native; contentfiles; analyzers; buildtransitive\u003c/IncludeAssets\u003e\n    \u003c/PackageReference\u003e\n    \u003cPackageReference Include=\"Microsoft.Extensions.Logging.Debug\" Version=\"3.1.2\" /\u003e\n    \u003cPackageReference Include=\"Microsoft.VisualStudio.Web.CodeGeneration.Design\" Version=\"3.1.1\" /\u003e\n  \u003c/ItemGroup\u003e\n  \n// New\n\u003cProject Sdk=\"Microsoft.NET.Sdk.Web\"\u003e\n  \u003cPropertyGroup\u003e\n    ---\n  \u003c/PropertyGroup\u003e\n \n  \u003cItemGroup\u003e\n    \u003cPackageReference Include=\"Microsoft.EntityFrameworkCore.Tools\" Version=\"6.0.2\"\u003e\n    \u003cPrivateAssets\u003eall\u003c/PrivateAssets\u003e\n    \u003cIncludeAssets\u003eruntime; build; native; contentfiles; analyzers; buildtransitive\u003c/IncludeAssets\u003e\n    \u003c/PackageReference\u003e\n    \u003cPackageReference Include=\"Microsoft.Extensions.Logging.Debug\" Version=\"6.0.0\" /\u003e\n    \u003cPackageReference Include=\"Microsoft.VisualStudio.Web.CodeGeneration.Design\" Version=\"6.0.2\" /\u003e\n  \u003c/ItemGroup\u003e\n  \u003cItemGroup\u003e\n    \u003cProjectReference Include=\"..\\Library.Application\\Library.Application.csproj\" /\u003e\n    \u003cProjectReference Include=\"..\\Library.Infrastructure\\Library.Infrastructure.csproj\" /\u003e\n  \u003c/ItemGroup\u003e\n\u003c/Project\u003e\n  ````\n  \n- Upgrade the namespaces\n```\n//Old\nnamespace Library.Domain\n{\n    public class Author\n    {\n        public int Id { get; set; }\n        public string Name { get; set; } = string.Empty;\n        public IList\u003cBookDetails\u003e? Books { get; set; }\n    }\n}\n\n// New\nnamespace Library.Domain;\npublic class Author\n{\n    public int Id { get; set; }\n    public string Name { get; set; } = string.Empty;\n    public IList\u003cBookDetails\u003e? Books { get; set; }\n}\n````\n\n- Migrate startup class to Program.cs\n```\n//Old StartUp class\nusing Library.Application.Interfaces;\nusing Library.Infrastructure.Persistence;\nusing Library.Infrastructure.Services;\nusing Microsoft.AspNetCore.Builder;\nusing Microsoft.AspNetCore.Hosting;\nusing Microsoft.EntityFrameworkCore;\nusing Microsoft.Extensions.Configuration;\nusing Microsoft.Extensions.DependencyInjection;\nusing Microsoft.Extensions.Hosting;\n\nnamespace Library.MVC\n{\n    public class Startup\n    {\n        public Startup(IConfiguration configuration)\n        {\n            Configuration = configuration;\n        }\n\n        public IConfiguration Configuration { get; }\n\n        // This method gets called by the runtime. Use this method to add services to the container.\n        public void ConfigureServices(IServiceCollection services)\n        {\n            services.AddControllersWithViews();\n            //  Here we inject our services into the the DI container\n            services.AddScoped\u003cIBookService, BookService\u003e();\n            services.AddScoped\u003cIAuthorService, AuthorService\u003e();\n            services.AddScoped\u003cIBookCopyService, BookCopyService\u003e();\n            services.AddScoped\u003cILoanService, LoanService\u003e();\n            services.AddScoped\u003cIMemberService, MemberService\u003e();\n            services.AddScoped\u003cIBookCopyLoanService, BookCopyLoanService\u003e();\n\n            // This call injects our applicationDbContext (our implementation of Entity Framework Core)\n            services.AddDbContext\u003cApplicationDbContext\u003e(options =\u003e\n                options.UseSqlServer(Configuration.GetConnectionString(\"LibrarySystem\"),\n                x =\u003e x.MigrationsAssembly(typeof(ApplicationDbContext).Assembly.FullName)\n            ));\n        }\n\n        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.\n        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)\n        {\n            if (env.IsDevelopment())\n            {\n                app.UseDeveloperExceptionPage();\n            }\n            else\n            {\n                app.UseExceptionHandler(\"/Home/Error\");\n                // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.\n                app.UseHsts();\n            }\n            app.UseHttpsRedirection();\n            app.UseStaticFiles();\n\n            app.UseRouting();\n\n            app.UseAuthorization();\n\n            app.UseEndpoints(endpoints =\u003e\n            {\n                endpoints.MapControllerRoute(\n                    name: \"default\",\n                    pattern: \"{controller=Home}/{action=Index}/{id?}\");\n            });\n        }\n    }\n}\n\n\n//New Programm class\nusing Library.Application.Interfaces;\nusing Library.Infrastructure.Services;\nvar builder = WebApplication.CreateBuilder(args);\n\n// Add services to the container.\nbuilder.Services.AddControllersWithViews();\n\n//DbContext configuration\nbuilder.Services.AddDbContext\u003cApplicationDbContext\u003e(options =\u003e options.UseSqlServer(\n    builder.Configuration.GetConnectionString(\"LibrarySystem\"),\n    b =\u003e b.MigrationsAssembly(typeof(ApplicationDbContext).Assembly.FullName))\n);\n\n//Services configuration\nbuilder.Services.AddScoped\u003cIBookService, BookService\u003e();\nbuilder.Services.AddScoped\u003cIAuthorService, AuthorService\u003e();\nbuilder.Services.AddScoped\u003cIBookCopyService, BookCopyService\u003e();\nbuilder.Services.AddScoped\u003cILoanService, LoanService\u003e();\nbuilder.Services.AddScoped\u003cIMemberService, MemberService\u003e();\nbuilder.Services.AddScoped\u003cIBookCopyLoanService, BookCopyLoanService\u003e();\n\nbuilder.Services.AddRazorPages();\n\n\nvar app = builder.Build();\n\n// Configure the HTTP request pipeline.\nif (!app.Environment.IsDevelopment())\n{ \n    app.UseExceptionHandler(\"/Error\");\n    // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.\n    app.UseHsts();\n}\n\napp.UseAuthentication();\napp.UseStaticFiles();\n\napp.UseRouting();\n\napp.MapRazorPages();\n\napp.UseEndpoints(endpoints =\u003e\n{\n    endpoints.MapControllerRoute(\n        name: \"default\",\n        pattern: \"{controller=Home}/{action=Index}/{id?}\");\n});\n\napp.Run();\n```\n\n- Delete the old bin and obj folders\n- Build your application\n\n🚀 Ready to go\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsyst%2Flibrary-management-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsyst%2Flibrary-management-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsyst%2Flibrary-management-system/lists"}