├── .gitattributes ├── .gitignore ├── ADMINBYPARTHIB ├── ADMINBYPARTHIB.sln └── ADMINBYPARTHIB │ ├── ADMINBYPARTHIB.csproj │ ├── Controllers │ ├── HomeController.cs │ └── MatchUserController.cs │ ├── Models │ ├── ErrorViewModel.cs │ ├── User.cs │ └── UserDet.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Privacy.cshtml │ ├── MatchUser │ │ ├── Home.cshtml │ │ ├── IncorrectPassword.cshtml │ │ └── Welcome.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ ├── _Layout.cshtml.css │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-grid.rtl.css │ │ ├── bootstrap-grid.rtl.css.map │ │ ├── bootstrap-grid.rtl.min.css │ │ ├── bootstrap-grid.rtl.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap-reboot.rtl.css │ │ ├── bootstrap-reboot.rtl.css.map │ │ ├── bootstrap-reboot.rtl.min.css │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ ├── bootstrap-utilities.css │ │ ├── bootstrap-utilities.css.map │ │ ├── bootstrap-utilities.min.css │ │ ├── bootstrap-utilities.min.css.map │ │ ├── bootstrap-utilities.rtl.css │ │ ├── bootstrap-utilities.rtl.css.map │ │ ├── bootstrap-utilities.rtl.min.css │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ ├── bootstrap.rtl.css │ │ ├── bootstrap.rtl.css.map │ │ ├── bootstrap.rtl.min.css │ │ └── bootstrap.rtl.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.esm.js │ │ ├── bootstrap.esm.js.map │ │ ├── bootstrap.esm.min.js │ │ ├── bootstrap.esm.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── ADO_DOTNET_SQL_CONNECTION ├── ADO_DOTNET_SQL_CONNECTION.sln └── ADO_DOTNET_SQL_CONNECTION │ ├── ADO_DOTNET_SQL_CONNECTION.csproj │ ├── App.config │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ ├── bin │ └── Debug │ │ ├── ADO_DOTNET_SQL_CONNECTION.exe │ │ ├── ADO_DOTNET_SQL_CONNECTION.exe.config │ │ └── ADO_DOTNET_SQL_CONNECTION.pdb │ └── obj │ └── Debug │ ├── ADO_DOTNET_SQL_CONNECTION.csproj.AssemblyReference.cache │ ├── ADO_DOTNET_SQL_CONNECTION.csproj.CoreCompileInputs.cache │ ├── ADO_DOTNET_SQL_CONNECTION.csproj.FileListAbsolute.txt │ ├── ADO_DOTNET_SQL_CONNECTION.csproj.SuggestedBindingRedirects.cache │ ├── ADO_DOTNET_SQL_CONNECTION.exe │ ├── ADO_DOTNET_SQL_CONNECTION.pdb │ └── DesignTimeResolveAssemblyReferencesInput.cache ├── College Space ├── College Space │ ├── Controllers │ │ ├── AuthController.cs │ │ ├── EventsController.cs │ │ ├── HomeController.cs │ │ └── StudentViewController.cs │ ├── Data │ │ └── College_SpaceContext.cs │ ├── Event Manager.csproj │ ├── Migrations │ │ ├── 20221116093902_InitialMigration.Designer.cs │ │ ├── 20221116093902_InitialMigration.cs │ │ └── College_SpaceContextModelSnapshot.cs │ ├── Models │ │ ├── ErrorViewModel.cs │ │ ├── Event.cs │ │ ├── User.cs │ │ └── UserDet.cs │ ├── Program.cs │ ├── Properties │ │ ├── launchSettings.json │ │ ├── serviceDependencies.json │ │ └── serviceDependencies.local.json │ ├── Views │ │ ├── Auth │ │ │ └── CheckUser.cshtml │ │ ├── Events │ │ │ ├── Create.cshtml │ │ │ ├── Delete.cshtml │ │ │ ├── Details.cshtml │ │ │ ├── Edit.cshtml │ │ │ └── Index.cshtml │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _Layout.cshtml │ │ │ ├── _Layout.cshtml.css │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── StudentView │ │ │ └── StudentViewTable.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ ├── ButtonStyle.css │ │ ├── HOMEBG.jpg │ │ ├── HomeBack.jpg │ │ ├── LOGINBG.png │ │ ├── LogInBG.jpg │ │ ├── LogInStyle.css │ │ ├── TableStyle.css │ │ ├── TeacherG.jpg │ │ └── site.css │ │ ├── favicon1.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-grid.rtl.css │ │ │ ├── bootstrap-grid.rtl.css.map │ │ │ ├── bootstrap-grid.rtl.min.css │ │ │ ├── bootstrap-grid.rtl.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap-reboot.rtl.css │ │ │ ├── bootstrap-reboot.rtl.css.map │ │ │ ├── bootstrap-reboot.rtl.min.css │ │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ │ ├── bootstrap-utilities.css │ │ │ ├── bootstrap-utilities.css.map │ │ │ ├── bootstrap-utilities.min.css │ │ │ ├── bootstrap-utilities.min.css.map │ │ │ ├── bootstrap-utilities.rtl.css │ │ │ ├── bootstrap-utilities.rtl.css.map │ │ │ ├── bootstrap-utilities.rtl.min.css │ │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap.min.css.map │ │ │ ├── bootstrap.rtl.css │ │ │ ├── bootstrap.rtl.css.map │ │ │ ├── bootstrap.rtl.min.css │ │ │ └── bootstrap.rtl.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.esm.js │ │ │ ├── bootstrap.esm.js.map │ │ │ ├── bootstrap.esm.min.js │ │ │ ├── bootstrap.esm.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map └── Event Manager.sln ├── ConsoleApp1 ├── App.config ├── ConsoleApp1.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── ConsoleApp2 ├── App.config ├── ConsoleApp2.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── Database_First_Approach.txt ├── Database_First_Approach ├── DatabaseFirstAppPK.sln ├── DatabaseFirstAppPK │ ├── Controllers │ │ ├── Car.cs │ │ └── HomeController.cs │ ├── DatabaseFirstAppPK.csproj │ ├── Models │ │ ├── CarDbContext.cs │ │ ├── CarTable.cs │ │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Views │ │ ├── Car │ │ │ ├── Create.cshtml │ │ │ ├── Delete.cshtml │ │ │ ├── Details.cshtml │ │ │ ├── Edit.cshtml │ │ │ └── Index.cshtml │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _Layout.cshtml │ │ │ ├── _Layout.cshtml.css │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ └── site.css │ │ ├── favicon.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-grid.rtl.css │ │ │ ├── bootstrap-grid.rtl.css.map │ │ │ ├── bootstrap-grid.rtl.min.css │ │ │ ├── bootstrap-grid.rtl.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap-reboot.rtl.css │ │ │ ├── bootstrap-reboot.rtl.css.map │ │ │ ├── bootstrap-reboot.rtl.min.css │ │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ │ ├── bootstrap-utilities.css │ │ │ ├── bootstrap-utilities.css.map │ │ │ ├── bootstrap-utilities.min.css │ │ │ ├── bootstrap-utilities.min.css.map │ │ │ ├── bootstrap-utilities.rtl.css │ │ │ ├── bootstrap-utilities.rtl.css.map │ │ │ ├── bootstrap-utilities.rtl.min.css │ │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap.min.css.map │ │ │ ├── bootstrap.rtl.css │ │ │ ├── bootstrap.rtl.css.map │ │ │ ├── bootstrap.rtl.min.css │ │ │ └── bootstrap.rtl.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.esm.js │ │ │ ├── bootstrap.esm.js.map │ │ │ ├── bootstrap.esm.min.js │ │ │ ├── bootstrap.esm.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map └── Readme.md ├── EF_Code_First_Approach ├── EF_Code_First_Approach.sln ├── EF_Code_First_Approach │ ├── Controllers │ │ ├── HomeController.cs │ │ └── MobilesController.cs │ ├── Data │ │ └── EF_Code_First_ApproachContext.cs │ ├── EF_Code_First_Approach.csproj │ ├── Migrations │ │ ├── 20221115091541_InitialMigration.Designer.cs │ │ ├── 20221115091541_InitialMigration.cs │ │ └── EF_Code_First_ApproachContextModelSnapshot.cs │ ├── Models │ │ ├── ErrorViewModel.cs │ │ └── Mobile.cs │ ├── Program.cs │ ├── Properties │ │ ├── launchSettings.json │ │ ├── serviceDependencies.json │ │ └── serviceDependencies.local.json │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Mobiles │ │ │ ├── Create.cshtml │ │ │ ├── Delete.cshtml │ │ │ ├── Details.cshtml │ │ │ ├── Edit.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _Layout.cshtml │ │ │ ├── _Layout.cshtml.css │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── css │ │ └── site.css │ │ ├── favicon.ico │ │ ├── js │ │ └── site.js │ │ └── lib │ │ ├── bootstrap │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-grid.css │ │ │ ├── bootstrap-grid.css.map │ │ │ ├── bootstrap-grid.min.css │ │ │ ├── bootstrap-grid.min.css.map │ │ │ ├── bootstrap-grid.rtl.css │ │ │ ├── bootstrap-grid.rtl.css.map │ │ │ ├── bootstrap-grid.rtl.min.css │ │ │ ├── bootstrap-grid.rtl.min.css.map │ │ │ ├── bootstrap-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap-reboot.rtl.css │ │ │ ├── bootstrap-reboot.rtl.css.map │ │ │ ├── bootstrap-reboot.rtl.min.css │ │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ │ ├── bootstrap-utilities.css │ │ │ ├── bootstrap-utilities.css.map │ │ │ ├── bootstrap-utilities.min.css │ │ │ ├── bootstrap-utilities.min.css.map │ │ │ ├── bootstrap-utilities.rtl.css │ │ │ ├── bootstrap-utilities.rtl.css.map │ │ │ ├── bootstrap-utilities.rtl.min.css │ │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ ├── bootstrap.min.css.map │ │ │ ├── bootstrap.rtl.css │ │ │ ├── bootstrap.rtl.css.map │ │ │ ├── bootstrap.rtl.min.css │ │ │ └── bootstrap.rtl.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.min.js.map │ │ │ ├── bootstrap.esm.js │ │ │ ├── bootstrap.esm.js.map │ │ │ ├── bootstrap.esm.min.js │ │ │ ├── bootstrap.esm.min.js.map │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.js.map │ │ │ ├── bootstrap.min.js │ │ │ └── bootstrap.min.js.map │ │ ├── jquery-validation-unobtrusive │ │ ├── LICENSE.txt │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map └── Readme.md ├── EMP_SAL_CALCULATOR ├── EMP_SAL_CALCULATOR.sln └── EMP_SAL_CALCULATOR │ ├── Controllers │ ├── HomeController.cs │ └── SalaryController.cs │ ├── EMP_SAL_CALCULATOR.csproj │ ├── Models │ ├── ErrorViewModel.cs │ └── SalDet.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Privacy.cshtml │ ├── Salary │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ ├── _Layout.cshtml.css │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-grid.rtl.css │ │ ├── bootstrap-grid.rtl.css.map │ │ ├── bootstrap-grid.rtl.min.css │ │ ├── bootstrap-grid.rtl.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap-reboot.rtl.css │ │ ├── bootstrap-reboot.rtl.css.map │ │ ├── bootstrap-reboot.rtl.min.css │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ ├── bootstrap-utilities.css │ │ ├── bootstrap-utilities.css.map │ │ ├── bootstrap-utilities.min.css │ │ ├── bootstrap-utilities.min.css.map │ │ ├── bootstrap-utilities.rtl.css │ │ ├── bootstrap-utilities.rtl.css.map │ │ ├── bootstrap-utilities.rtl.min.css │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ ├── bootstrap.rtl.css │ │ ├── bootstrap.rtl.css.map │ │ ├── bootstrap.rtl.min.css │ │ └── bootstrap.rtl.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.esm.js │ │ ├── bootstrap.esm.js.map │ │ ├── bootstrap.esm.min.js │ │ ├── bootstrap.esm.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── FIRSTMVCAPP ├── FIRSTMVCAPP.sln └── FIRSTMVCAPP │ ├── Controllers │ ├── GetEmpDataController.cs │ ├── HomeController.cs │ └── TestController.cs │ ├── FIRSTMVCAPP.csproj │ ├── Models │ ├── Employee.cs │ ├── ErrorViewModel.cs │ └── GetEmpData.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Views │ ├── GetEmpData │ │ ├── GetEmpDet.cshtml │ │ ├── ShowEmpData.cshtml │ │ └── ShowEmpDet.cshtml │ ├── Home │ │ ├── Index.cshtml │ │ └── Privacy.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ ├── _Layout.cshtml.css │ │ └── _ValidationScriptsPartial.cshtml │ ├── Test │ │ └── Message.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ ├── css │ └── site.css │ ├── favicon.ico │ ├── js │ └── site.js │ └── lib │ ├── bootstrap │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-grid.rtl.css │ │ ├── bootstrap-grid.rtl.css.map │ │ ├── bootstrap-grid.rtl.min.css │ │ ├── bootstrap-grid.rtl.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap-reboot.rtl.css │ │ ├── bootstrap-reboot.rtl.css.map │ │ ├── bootstrap-reboot.rtl.min.css │ │ ├── bootstrap-reboot.rtl.min.css.map │ │ ├── bootstrap-utilities.css │ │ ├── bootstrap-utilities.css.map │ │ ├── bootstrap-utilities.min.css │ │ ├── bootstrap-utilities.min.css.map │ │ ├── bootstrap-utilities.rtl.css │ │ ├── bootstrap-utilities.rtl.css.map │ │ ├── bootstrap-utilities.rtl.min.css │ │ ├── bootstrap-utilities.rtl.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ ├── bootstrap.min.css.map │ │ ├── bootstrap.rtl.css │ │ ├── bootstrap.rtl.css.map │ │ ├── bootstrap.rtl.min.css │ │ └── bootstrap.rtl.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.esm.js │ │ ├── bootstrap.esm.js.map │ │ ├── bootstrap.esm.min.js │ │ ├── bootstrap.esm.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map │ ├── jquery-validation-unobtrusive │ ├── LICENSE.txt │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── FIRST_MVC_APP.txt ├── FirstApp.sln ├── FirstApp ├── App.config ├── FirstApp.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── LICENCE.md ├── Labday21-10-22 ├── App.config ├── Labday21-10-22.csproj ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── Parthib_Kumar_Sarkar_DotNET(Theory Exam).pdf ├── RoleJWTbyParthib ├── RoleJWT.sln └── RoleJWT │ ├── Controllers │ ├── AuthController.cs │ ├── UserController.cs │ └── WeatherForecastController.cs │ ├── Data │ └── ApplicationDBContext.cs │ ├── Migrations │ ├── 20230104064705_SecondMigration.Designer.cs │ ├── 20230104064705_SecondMigration.cs │ ├── 20230105091732_ThirdMigration.Designer.cs │ ├── 20230105091732_ThirdMigration.cs │ └── ApplicationDBContextModelSnapshot.cs │ ├── Models │ ├── AddNewUser.cs │ ├── EditRole.cs │ ├── Login.cs │ ├── Register.cs │ └── User.cs │ ├── Program.cs │ ├── Properties │ ├── launchSettings.json │ ├── serviceDependencies.json │ └── serviceDependencies.local.json │ ├── RolebasedJWTbyParthib.csproj │ ├── WeatherForecast.cs │ ├── appsettings.Development.json │ └── appsettings.json ├── SQL-LAB ├── SQLQuery1.sql ├── SQLQuery14.sql ├── Trigger.sql └── TriggerReal.sql └── WEBAPI ├── WEBAPI.sln └── WEBAPI ├── Controllers ├── TestController.cs └── WeatherForecastController.cs ├── Program.cs ├── Properties └── launchSettings.json ├── WEBAPI.csproj ├── WeatherForecast.cs ├── appsettings.Development.json └── appsettings.json /ADMINBYPARTHIB/ADMINBYPARTHIB.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ADMINBYPARTHIB", "ADMINBYPARTHIB\ADMINBYPARTHIB.csproj", "{13EB8AF4-FB84-4F70-AD78-1C7F501FF657}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {13EB8AF4-FB84-4F70-AD78-1C7F501FF657}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {13EB8AF4-FB84-4F70-AD78-1C7F501FF657}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {13EB8AF4-FB84-4F70-AD78-1C7F501FF657}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {13EB8AF4-FB84-4F70-AD78-1C7F501FF657}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {11D4D280-E08D-4D2A-A15C-9D7C95197E99} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/ADMINBYPARTHIB.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using ADMINBYPARTHIB.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Diagnostics; 4 | 5 | namespace ADMINBYPARTHIB.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | private readonly ILogger _logger; 10 | 11 | public HomeController(ILogger logger) 12 | { 13 | _logger = logger; 14 | } 15 | 16 | public IActionResult Index() 17 | { 18 | return View(); 19 | } 20 | 21 | public IActionResult Privacy() 22 | { 23 | return View(); 24 | } 25 | 26 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 27 | public IActionResult Error() 28 | { 29 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Controllers/MatchUserController.cs: -------------------------------------------------------------------------------- 1 | using ADMINBYPARTHIB.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace ADMINBYPARTHIB.Controllers 5 | { 6 | public class MatchUserController : Controller 7 | { 8 | public IActionResult CheckUser(string Password, string username) 9 | { 10 | User us = new User(); 11 | us.userName = username; 12 | us.password = Password; 13 | 14 | if(us.userName == "admin" && us.password == "admin") 15 | { 16 | return View("Welcome"); 17 | } 18 | return View("IncorrectPassword"); 19 | 20 | 21 | } 22 | public IActionResult Home() 23 | { 24 | return View(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace ADMINBYPARTHIB.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Models/User.cs: -------------------------------------------------------------------------------- 1 | namespace ADMINBYPARTHIB.Models 2 | { 3 | public class User 4 | { 5 | public string? userName { get; set; } 6 | public string? password { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Models/UserDet.cs: -------------------------------------------------------------------------------- 1 | namespace ADMINBYPARTHIB.Models 2 | { 3 | public class UserDet 4 | { 5 | public User GetDet(string username,string Password) 6 | { 7 | User us = new User(); 8 | us.userName = username; 9 | us.password = Password; 10 | return us; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | // Add services to the container. 4 | builder.Services.AddControllersWithViews(); 5 | 6 | var app = builder.Build(); 7 | 8 | // Configure the HTTP request pipeline. 9 | if (!app.Environment.IsDevelopment()) 10 | { 11 | app.UseExceptionHandler("/Home/Error"); 12 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 13 | app.UseHsts(); 14 | } 15 | 16 | app.UseHttpsRedirection(); 17 | app.UseStaticFiles(); 18 | 19 | app.UseRouting(); 20 | 21 | app.UseAuthorization(); 22 | 23 | app.MapControllerRoute( 24 | name: "default", 25 | pattern: "{controller=Home}/{action=Index}/{id?}"); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:55897", 7 | "sslPort": 44384 8 | } 9 | }, 10 | "profiles": { 11 | "ADMINBYPARTHIB": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "https://localhost:7255;http://localhost:5255", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/MatchUser/Home.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 |
7 |
8 | 9 | 10 |
11 | Enter Password: 12 | 13 |
14 | 15 |
16 |
17 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/MatchUser/IncorrectPassword.cshtml: -------------------------------------------------------------------------------- 1 |  2 |
3 |

Incorrect Password

4 |
5 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/MatchUser/Welcome.cshtml: -------------------------------------------------------------------------------- 1 |  2 |
3 |

4 | Welcome to the page !!!!!!!!! 5 |

6 |
7 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/Shared/_Layout.cshtml.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | a { 11 | color: #0077cc; 12 | } 13 | 14 | .btn-primary { 15 | color: #fff; 16 | background-color: #1b6ec2; 17 | border-color: #1861ac; 18 | } 19 | 20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 21 | color: #fff; 22 | background-color: #1b6ec2; 23 | border-color: #1861ac; 24 | } 25 | 26 | .border-top { 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | .border-bottom { 30 | border-bottom: 1px solid #e5e5e5; 31 | } 32 | 33 | .box-shadow { 34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 35 | } 36 | 37 | button.accept-policy { 38 | font-size: 1rem; 39 | line-height: inherit; 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | white-space: nowrap; 47 | line-height: 60px; 48 | } 49 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using ADMINBYPARTHIB 2 | @using ADMINBYPARTHIB.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | 16 | body { 17 | margin-bottom: 60px; 18 | } -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/ADMINBYPARTHIB/ADMINBYPARTHIB/wwwroot/favicon.ico -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2021 Twitter, Inc. 4 | Copyright (c) 2011-2021 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /ADMINBYPARTHIB/ADMINBYPARTHIB/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ADO_DOTNET_SQL_CONNECTION", "ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION.csproj", "{3E924F62-0AB6-40B2-BC1C-B3EC5F36A08A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3E924F62-0AB6-40B2-BC1C-B3EC5F36A08A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3E924F62-0AB6-40B2-BC1C-B3EC5F36A08A}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3E924F62-0AB6-40B2-BC1C-B3EC5F36A08A}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3E924F62-0AB6-40B2-BC1C-B3EC5F36A08A}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {EFEF2E31-27E8-4714-9718-0B7ACC7EF94F} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ADO_DOTNET_SQL_CONNECTION")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("HP")] 12 | [assembly: AssemblyProduct("ADO_DOTNET_SQL_CONNECTION")] 13 | [assembly: AssemblyCopyright("Copyright © HP 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("3e924f62-0ab6-40b2-bc1c-b3ec5f36a08a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/bin/Debug/ADO_DOTNET_SQL_CONNECTION.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/bin/Debug/ADO_DOTNET_SQL_CONNECTION.exe -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/bin/Debug/ADO_DOTNET_SQL_CONNECTION.exe.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/bin/Debug/ADO_DOTNET_SQL_CONNECTION.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/bin/Debug/ADO_DOTNET_SQL_CONNECTION.pdb -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.csproj.CoreCompileInputs.cache: -------------------------------------------------------------------------------- 1 | 7f4b213b428f4c013f19137338418ee1f5525793 2 | -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.csproj.FileListAbsolute.txt: -------------------------------------------------------------------------------- 1 | C:\Users\PARTHIB SARKAR\source\repos\ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION\bin\Debug\ADO_DOTNET_SQL_CONNECTION.exe.config 2 | C:\Users\PARTHIB SARKAR\source\repos\ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION\bin\Debug\ADO_DOTNET_SQL_CONNECTION.exe 3 | C:\Users\PARTHIB SARKAR\source\repos\ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION\bin\Debug\ADO_DOTNET_SQL_CONNECTION.pdb 4 | C:\Users\PARTHIB SARKAR\source\repos\ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION\obj\Debug\ADO_DOTNET_SQL_CONNECTION.csproj.AssemblyReference.cache 5 | C:\Users\PARTHIB SARKAR\source\repos\ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION\obj\Debug\ADO_DOTNET_SQL_CONNECTION.csproj.SuggestedBindingRedirects.cache 6 | C:\Users\PARTHIB SARKAR\source\repos\ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION\obj\Debug\ADO_DOTNET_SQL_CONNECTION.csproj.CoreCompileInputs.cache 7 | C:\Users\PARTHIB SARKAR\source\repos\ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION\obj\Debug\ADO_DOTNET_SQL_CONNECTION.exe 8 | C:\Users\PARTHIB SARKAR\source\repos\ADO_DOTNET_SQL_CONNECTION\ADO_DOTNET_SQL_CONNECTION\obj\Debug\ADO_DOTNET_SQL_CONNECTION.pdb 9 | -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.csproj.SuggestedBindingRedirects.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.csproj.SuggestedBindingRedirects.cache -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.exe -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/ADO_DOTNET_SQL_CONNECTION.pdb -------------------------------------------------------------------------------- /ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/ADO_DOTNET_SQL_CONNECTION/ADO_DOTNET_SQL_CONNECTION/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /College Space/College Space/Controllers/AuthController.cs: -------------------------------------------------------------------------------- 1 | using College_Space.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace College_Space.Controllers 5 | { 6 | public class AuthController : Controller 7 | { 8 | public IActionResult CheckUser(string Password, string username) 9 | { 10 | User us = new User(); 11 | us.UserName = username; 12 | us.PassWord = Password; 13 | 14 | if (us.UserName == "teacher" && us.PassWord == "teacher") 15 | { 16 | return this.RedirectToAction("Index", "Events"); 17 | } 18 | else if (us.UserName == "student" && us.PassWord == "student") 19 | { 20 | return this.RedirectToAction("StudentViewTable", "StudentView"); 21 | } 22 | else 23 | { 24 | return View(); 25 | } 26 | 27 | } 28 | public IActionResult Home() 29 | { 30 | return View(); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /College Space/College Space/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using College_Space.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Diagnostics; 4 | 5 | namespace College_Space.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | 10 | private readonly ILogger _logger; 11 | 12 | public HomeController(ILogger logger) 13 | { 14 | _logger = logger; 15 | } 16 | /*public IActionResult CheckUser(string Password, string username) 17 | { 18 | User us = new User(); 19 | us.UserName = username; 20 | us.PassWord = Password; 21 | 22 | if (us.UserName == "admin" && us.PassWord == "admin") 23 | { 24 | return RedirectToAction("Index", "Events"); 25 | } 26 | else 27 | { 28 | return this.RedirectToAction("StudentViewTable", "StudentView"); 29 | } 30 | }*/ 31 | 32 | public IActionResult Index() 33 | { 34 | return this.RedirectToAction("CheckUser","Auth"); 35 | } 36 | 37 | public IActionResult Privacy() 38 | { 39 | return View(); 40 | } 41 | 42 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 43 | public IActionResult Error() 44 | { 45 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 46 | } 47 | 48 | 49 | } 50 | } -------------------------------------------------------------------------------- /College Space/College Space/Controllers/StudentViewController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.AspNetCore.Mvc.Rendering; 7 | using Microsoft.EntityFrameworkCore; 8 | using College_Space.Data; 9 | using College_Space.Models; 10 | 11 | namespace College_Space.Controllers 12 | { 13 | public class StudentViewController : Controller 14 | { 15 | private readonly College_SpaceContext _context; 16 | 17 | public StudentViewController(College_SpaceContext context) 18 | { 19 | _context = context; 20 | } 21 | 22 | // GET: Events 23 | public async Task StudentViewTable() 24 | { 25 | return View(await _context.Events.ToListAsync()); 26 | } 27 | 28 | private bool EventsExists(int id) 29 | { 30 | return _context.Events.Any(e => e.EventId == id); 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /College Space/College Space/Data/College_SpaceContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.EntityFrameworkCore; 6 | using College_Space.Models; 7 | 8 | namespace College_Space.Data 9 | { 10 | public class College_SpaceContext : DbContext 11 | { 12 | public College_SpaceContext (DbContextOptions options) 13 | : base(options) 14 | { 15 | } 16 | 17 | public DbSet Events { get; set; } = default!; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /College Space/College Space/Event Manager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | College_Space 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | all 18 | runtime; build; native; contentfiles; analyzers; buildtransitive 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /College Space/College Space/Migrations/20221116093902_InitialMigration.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using College_Space.Data; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.Infrastructure; 6 | using Microsoft.EntityFrameworkCore.Metadata; 7 | using Microsoft.EntityFrameworkCore.Migrations; 8 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 9 | 10 | #nullable disable 11 | 12 | namespace CollegeSpace.Migrations 13 | { 14 | [DbContext(typeof(College_SpaceContext))] 15 | [Migration("20221116093902_InitialMigration")] 16 | partial class InitialMigration 17 | { 18 | /// 19 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 20 | { 21 | #pragma warning disable 612, 618 22 | modelBuilder 23 | .HasAnnotation("ProductVersion", "7.0.0") 24 | .HasAnnotation("Relational:MaxIdentifierLength", 128); 25 | 26 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); 27 | 28 | modelBuilder.Entity("College_Space.Models.Event", b => 29 | { 30 | b.Property("EventId") 31 | .ValueGeneratedOnAdd() 32 | .HasColumnType("int"); 33 | 34 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("EventId")); 35 | 36 | b.Property("EventDate") 37 | .HasColumnType("datetime2"); 38 | 39 | b.Property("EventName") 40 | .HasColumnType("nvarchar(max)"); 41 | 42 | b.Property("EventOrganizer") 43 | .HasColumnType("nvarchar(max)"); 44 | 45 | b.Property("EventType") 46 | .HasColumnType("nvarchar(max)"); 47 | 48 | b.HasKey("EventId"); 49 | 50 | b.ToTable("Events"); 51 | }); 52 | #pragma warning restore 612, 618 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /College Space/College Space/Migrations/20221116093902_InitialMigration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace CollegeSpace.Migrations 7 | { 8 | /// 9 | public partial class InitialMigration : Migration 10 | { 11 | /// 12 | protected override void Up(MigrationBuilder migrationBuilder) 13 | { 14 | migrationBuilder.CreateTable( 15 | name: "Events", 16 | columns: table => new 17 | { 18 | EventId = table.Column(type: "int", nullable: false) 19 | .Annotation("SqlServer:Identity", "1, 1"), 20 | EventName = table.Column(type: "nvarchar(max)", nullable: true), 21 | EventOrganizer = table.Column(type: "nvarchar(max)", nullable: true), 22 | EventType = table.Column(type: "nvarchar(max)", nullable: true), 23 | EventDate = table.Column(type: "datetime2", nullable: true) 24 | }, 25 | constraints: table => 26 | { 27 | table.PrimaryKey("PK_Events", x => x.EventId); 28 | }); 29 | } 30 | 31 | /// 32 | protected override void Down(MigrationBuilder migrationBuilder) 33 | { 34 | migrationBuilder.DropTable( 35 | name: "Events"); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /College Space/College Space/Migrations/College_SpaceContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using College_Space.Data; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.Infrastructure; 6 | using Microsoft.EntityFrameworkCore.Metadata; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | #nullable disable 10 | 11 | namespace CollegeSpace.Migrations 12 | { 13 | [DbContext(typeof(College_SpaceContext))] 14 | partial class CollegeSpaceContextModelSnapshot : ModelSnapshot 15 | { 16 | protected override void BuildModel(ModelBuilder modelBuilder) 17 | { 18 | #pragma warning disable 612, 618 19 | modelBuilder 20 | .HasAnnotation("ProductVersion", "7.0.0") 21 | .HasAnnotation("Relational:MaxIdentifierLength", 128); 22 | 23 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); 24 | 25 | modelBuilder.Entity("College_Space.Models.Event", b => 26 | { 27 | b.Property("EventId") 28 | .ValueGeneratedOnAdd() 29 | .HasColumnType("int"); 30 | 31 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("EventId")); 32 | 33 | b.Property("EventDate") 34 | .HasColumnType("datetime2"); 35 | 36 | b.Property("EventName") 37 | .HasColumnType("nvarchar(max)"); 38 | 39 | b.Property("EventOrganizer") 40 | .HasColumnType("nvarchar(max)"); 41 | 42 | b.Property("EventType") 43 | .HasColumnType("nvarchar(max)"); 44 | 45 | b.HasKey("EventId"); 46 | 47 | b.ToTable("Events"); 48 | }); 49 | #pragma warning restore 612, 618 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /College Space/College Space/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace College_Space.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /College Space/College Space/Models/Event.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace College_Space.Models 5 | { 6 | public class Event 7 | { 8 | [Key] 9 | public int EventId { get; set; } 10 | 11 | [Required(ErrorMessage = "Event Name can't be blank!")] 12 | [MinLength(2, ErrorMessage = "Event Name must be meaningful!")] 13 | public string? EventName { get; set; } 14 | 15 | [Required(ErrorMessage = "Event Organizer can't be blank!")] 16 | [MinLength(2, ErrorMessage = "Enter valid Organizer!")] 17 | public string? EventOrganizer { get; set; } 18 | 19 | [Required(ErrorMessage = "Event Type can't be blank!")] 20 | [MinLength(2, ErrorMessage = "Enter valid Event Type!")] 21 | public string? EventType { get; set; } 22 | 23 | [Required(ErrorMessage = "Event Dtae & Time can't be empty!")] 24 | public DateTime? EventDate { get; set; } 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /College Space/College Space/Models/User.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace College_Space.Models 4 | { 5 | public class User 6 | { 7 | 8 | public string? UserName { get; set; } 9 | public string? PassWord { get; set; } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /College Space/College Space/Models/UserDet.cs: -------------------------------------------------------------------------------- 1 | namespace College_Space.Models 2 | { 3 | public class UserDet 4 | { 5 | public User GetDet(string username, string Password) 6 | { 7 | User us = new User(); 8 | us.UserName = username; 9 | us.PassWord = Password; 10 | return us; 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /College Space/College Space/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using College_Space.Data; 4 | var builder = WebApplication.CreateBuilder(args); 5 | builder.Services.AddDbContext(options => 6 | options.UseSqlServer(builder.Configuration.GetConnectionString("College_SpaceContext") ?? throw new InvalidOperationException("Connection string 'College_SpaceContext' not found."))); 7 | 8 | // Add services to the container. 9 | builder.Services.AddControllersWithViews(); 10 | 11 | var app = builder.Build(); 12 | 13 | // Configure the HTTP request pipeline. 14 | if (!app.Environment.IsDevelopment()) 15 | { 16 | app.UseExceptionHandler("/Home/Error"); 17 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 18 | app.UseHsts(); 19 | } 20 | 21 | app.UseHttpsRedirection(); 22 | app.UseStaticFiles(); 23 | 24 | app.UseRouting(); 25 | 26 | app.UseAuthorization(); 27 | 28 | app.MapControllerRoute( 29 | name: "default", 30 | pattern: "{controller=Home}/{action=Index}/{id?}"); 31 | 32 | app.Run(); 33 | -------------------------------------------------------------------------------- /College Space/College Space/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:42212", 7 | "sslPort": 44363 8 | } 9 | }, 10 | "profiles": { 11 | "College_Space": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "https://localhost:7191;http://localhost:5191", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /College Space/College Space/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mssql1": { 4 | "type": "mssql", 5 | "connectionId": "ConnectionStrings:College_SpaceContext" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /College Space/College Space/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mssql1": { 4 | "type": "mssql.local", 5 | "connectionId": "ConnectionStrings:College_SpaceContext" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /College Space/College Space/Views/Auth/CheckUser.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 | 6 | 7 | 8 | 9 | 10 | 20 | 21 | 29 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Events/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model College_Space.Models.Event 2 | 3 | 4 | @{ 5 | ViewData["Title"] = "Create"; 6 | } 7 | 8 | 9 | 10 |

Create New Events

11 | 12 |
13 |
14 |
15 |
16 |
17 |
18 | 19 | 20 | 21 |
22 |
23 |
24 | 25 | 26 | 27 |
28 |
29 |
30 | 31 | 32 | 33 |
34 |
35 |
36 | 37 | 38 | 39 |
40 |
41 |
42 | 43 | 44 |
45 |
46 |
47 |
48 |
49 | 50 | @*
51 | Back to List 52 |
*@ 53 | 54 | @section Scripts { 55 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 56 | } 57 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Events/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model College_Space.Models.Event 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 | 8 | 9 |

Delete Event

10 | 11 |

Are you sure you want to delete this?

12 |
13 |
14 |
15 |
16 | @Html.DisplayNameFor(model => model.EventName) 17 |
18 |
19 | @Html.DisplayFor(model => model.EventName) 20 |
21 |
22 | @Html.DisplayNameFor(model => model.EventOrganizer) 23 |
24 |
25 | @Html.DisplayFor(model => model.EventOrganizer) 26 |
27 |
28 | @Html.DisplayNameFor(model => model.EventType) 29 |
30 |
31 | @Html.DisplayFor(model => model.EventType) 32 |
33 |
34 | @Html.DisplayNameFor(model => model.EventDate) 35 |
36 |
37 | @Html.DisplayFor(model => model.EventDate) 38 |
39 |
40 | 41 |
42 | 43 | | 44 | 45 |
46 |
47 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Events/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model College_Space.Models.Event 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 | 8 |

Event Details

9 | 10 |
11 |
12 |
13 | @Html.DisplayNameFor(model => model.EventName) 14 |
15 |
16 | @Html.DisplayFor(model => model.EventName) 17 |
18 |
19 | @Html.DisplayNameFor(model => model.EventOrganizer) 20 |
21 |
22 | @Html.DisplayFor(model => model.EventOrganizer) 23 |
24 |
25 | @Html.DisplayNameFor(model => model.EventType) 26 |
27 |
28 | @Html.DisplayFor(model => model.EventType) 29 |
30 |
31 | @Html.DisplayNameFor(model => model.EventDate) 32 |
33 |
34 | @Html.DisplayFor(model => model.EventDate) 35 |
36 |
37 |
38 |
39 | | 40 | 41 |
42 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Events/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model College_Space.Models.Event 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | } 6 | 7 | 8 | 9 |

Edit Event Details

10 |
11 |
12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 | 20 |
21 |
22 |
23 | 24 | 25 | 26 |
27 |
28 |
29 | 30 | 31 | 32 |
33 |
34 |
35 | 36 | 37 | 38 |
39 |
40 |
41 | 42 | 43 |
44 |
45 |
46 | 47 |
48 | 49 | 50 | @section Scripts { 51 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 52 | } 53 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Events/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 17 | 20 | 23 | 26 | 27 | 28 | 29 | 30 | @foreach (var item in Model) { 31 | 32 | 35 | 38 | 41 | 44 | 49 | 50 | } 51 | 52 |
15 | @Html.DisplayNameFor(model => model.EventName) 16 | 18 | @Html.DisplayNameFor(model => model.EventOrganizer) 19 | 21 | @Html.DisplayNameFor(model => model.EventType) 22 | 24 | @Html.DisplayNameFor(model => model.EventDate) 25 |
33 | @Html.DisplayFor(modelItem => item.EventName) 34 | 36 | @Html.DisplayFor(modelItem => item.EventOrganizer) 37 | 39 | @Html.DisplayFor(modelItem => item.EventType) 40 | 42 | @Html.DisplayFor(modelItem => item.EventDate) 43 | 45 | | 46 | | 47 | 48 |
53 |
54 |
55 |
56 | 57 | 58 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Event Manager

7 |
8 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Shared/_Layout.cshtml.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | a { 11 | color: #0077cc; 12 | } 13 | 14 | .btn-primary { 15 | color: #fff; 16 | background-color: #1b6ec2; 17 | border-color: #1861ac; 18 | } 19 | 20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 21 | color: #fff; 22 | background-color: #1b6ec2; 23 | border-color: #1861ac; 24 | } 25 | 26 | .border-top { 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | .border-bottom { 30 | border-bottom: 1px solid #e5e5e5; 31 | } 32 | 33 | .box-shadow { 34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 35 | } 36 | 37 | button.accept-policy { 38 | font-size: 1rem; 39 | line-height: inherit; 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | white-space: nowrap; 47 | line-height: 60px; 48 | } 49 | -------------------------------------------------------------------------------- /College Space/College Space/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /College Space/College Space/Views/StudentView/StudentViewTable.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | 4 | 5 | 6 | 7 | 10 | 13 | 16 | 19 | 20 | 21 | 22 | @foreach (var item in Model) 23 | { 24 | 25 | 28 | 31 | 34 | 37 | 38 | } 39 | 40 |
8 | @Html.DisplayNameFor(model => model.EventName) 9 | 11 | @Html.DisplayNameFor(model => model.EventOrganizer) 12 | 14 | @Html.DisplayNameFor(model => model.EventType) 15 | 17 | @Html.DisplayNameFor(model => model.EventDate) 18 |
26 | @Html.DisplayFor(modelItem => item.EventName) 27 | 29 | @Html.DisplayFor(modelItem => item.EventOrganizer) 30 | 32 | @Html.DisplayFor(modelItem => item.EventType) 33 | 35 | @Html.DisplayFor(modelItem => item.EventDate) 36 |
41 | -------------------------------------------------------------------------------- /College Space/College Space/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using College_Space 2 | @using College_Space.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /College Space/College Space/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /College Space/College Space/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /College Space/College Space/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "College_SpaceContext": "Server=(localdb)\\mssqllocaldb;Database=College_Space.Data;Trusted_Connection=True;MultipleActiveResultSets=true" 11 | } 12 | } -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/ButtonStyle.css: -------------------------------------------------------------------------------- 1 | a { 2 | color: white; 3 | background-color: transparent; 4 | text-decoration: none; 5 | } 6 | 7 | a:hover { 8 | color: white; 9 | background-color: transparent; 10 | text-decoration: none; 11 | } 12 | -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/HOMEBG.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/College Space/College Space/wwwroot/css/HOMEBG.jpg -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/HomeBack.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/College Space/College Space/wwwroot/css/HomeBack.jpg -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/LOGINBG.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/College Space/College Space/wwwroot/css/LOGINBG.png -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/LogInBG.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/College Space/College Space/wwwroot/css/LogInBG.jpg -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/LogInStyle.css: -------------------------------------------------------------------------------- 1 | *{ 2 | padding:0; 3 | margin:0; 4 | font-family:sans-serif; 5 | } 6 | body { 7 | background-image:url('LogInBG.jpg'); 8 | background-size:cover; 9 | } 10 | 11 | .login-form{ 12 | width:350px; 13 | top:40%; 14 | left:50%; 15 | transform:translate(-50%,-50%); 16 | position:absolute; 17 | color:#fff; 18 | } 19 | .login-form h1{ 20 | text-align:center; 21 | font-size:39.8px; 22 | margin:40px 0; 23 | 24 | } 25 | .login-form p{ 26 | font-size:20px; 27 | margin:15px 0; 28 | } 29 | .login-form input{ 30 | font-size:16px; 31 | width:100%; 32 | padding:15px 10px; 33 | border: 0; 34 | outline: none; 35 | border-radius: 5px; 36 | } 37 | .login-form button{ 38 | font-size:18px; 39 | font-weight:bold; 40 | margin: 20px 0; 41 | padding: 10px 15px; 42 | width: 50%; 43 | border-radius:5px; 44 | cursor:pointer; 45 | } 46 | .login-form button:is(:hover) { 47 | background-color: #4CAF50; 48 | color: white; 49 | } 50 | footer { 51 | position: fixed; 52 | left: 0; 53 | bottom: 0; 54 | text-align: center; 55 | width: 100%; 56 | background-color: black; 57 | font-family: sans-serif; 58 | } -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/TableStyle.css: -------------------------------------------------------------------------------- 1 | body { 2 | text-align: center; 3 | } 4 | 5 | .table-style { 6 | border: 5px solid; 7 | text-align: center; 8 | } 9 | 10 | .table { 11 | justify-content: center; 12 | text-align: center; 13 | position: relative; 14 | } 15 | a{ 16 | color:white; 17 | background-color: transparent; 18 | text-decoration: none; 19 | } 20 | a:hover { 21 | color: white; 22 | background-color: transparent; 23 | text-decoration:none; 24 | } 25 | -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/TeacherG.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/College Space/College Space/wwwroot/css/TeacherG.jpg -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | 16 | body { 17 | margin-bottom: 60px; 18 | background-image: url('TeacherG.jpg'); 19 | background-size: cover; 20 | } 21 | 22 | footer{ 23 | position:fixed; 24 | left:0; 25 | bottom:0; 26 | text-align:center; 27 | width:100%; 28 | background-color:black; 29 | font-family:sans-serif; 30 | } 31 | a:link{ 32 | color:white; 33 | } -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/favicon1.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/College Space/College Space/wwwroot/favicon1.ico -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2021 Twitter, Inc. 4 | Copyright (c) 2011-2021 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /College Space/College Space/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /College Space/Event Manager.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Event Manager", "College Space\Event Manager.csproj", "{9099BEB3-5CBE-4A8B-8032-0E014F8D94BC}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {9099BEB3-5CBE-4A8B-8032-0E014F8D94BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {9099BEB3-5CBE-4A8B-8032-0E014F8D94BC}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {9099BEB3-5CBE-4A8B-8032-0E014F8D94BC}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {9099BEB3-5CBE-4A8B-8032-0E014F8D94BC}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9B3A5BE3-69AD-4B3F-AAF7-7961507CB955} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ConsoleApp1/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ConsoleApp1/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace ConsoleApp1 9 | { 10 | internal class Program 11 | { 12 | int i; 13 | Random random = new Random(); 14 | 15 | public void create() 16 | { 17 | while (true) 18 | { 19 | i=random.Next(10,20); 20 | if ((i%2) == 0) 21 | { 22 | Thread th1 = new Thread(Square); 23 | th1.Start(); 24 | } 25 | else 26 | { 27 | Thread th2 = new Thread(Cube); 28 | th2.Start(); 29 | } 30 | Thread.Sleep(2000); 31 | } 32 | 33 | } 34 | 35 | 36 | public void Cube() 37 | { 38 | Console.WriteLine("Cube value of " + i + " is: " + (i * i * i)); 39 | } 40 | public void Square() 41 | { 42 | Console.WriteLine("Square value of " + i + " is: " + (i * i)); 43 | } 44 | 45 | 46 | 47 | static void Main(string[] args) 48 | { 49 | 50 | Program obj = new Program(); 51 | Thread th = new Thread(obj.create); 52 | th.Start(); 53 | 54 | 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /ConsoleApp1/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConsoleApp1")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("HP")] 12 | [assembly: AssemblyProduct("ConsoleApp1")] 13 | [assembly: AssemblyCopyright("Copyright © HP 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("fbf0c019-a96e-4eb0-bdb0-521a2417dd9e")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /ConsoleApp2/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /ConsoleApp2/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | 8 | namespace ConsoleApp2 9 | { 10 | internal class Program 11 | { 12 | static int i = 3000, j = 2000, k = 1000; 13 | public static void Thread1() 14 | { 15 | while (true) 16 | { 17 | Thread t1 = new Thread(Program.GoodMorning); 18 | t1.Start(); 19 | Thread.Sleep(3000); 20 | Thread t2 = new Thread(Program.Hello); 21 | t2.Start(); 22 | Thread.Sleep(2000); 23 | Thread t3 = new Thread(Program.Welcome); 24 | t3.Start(); 25 | Thread.Sleep(1000); 26 | 27 | } 28 | 29 | } 30 | 31 | public static void GoodMorning() 32 | { 33 | Console.WriteLine("Good Morning"); 34 | } 35 | public static void Hello() 36 | { 37 | Console.WriteLine("Hello"); 38 | } 39 | public static void Welcome() 40 | { 41 | Console.WriteLine("Welcome"); 42 | } 43 | 44 | 45 | 46 | static void Main(string[] args) 47 | { 48 | Thread t1 = new Thread(Program.Thread1); 49 | t1.Start(); 50 | 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /ConsoleApp2/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("ConsoleApp2")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("HP")] 12 | [assembly: AssemblyProduct("ConsoleApp2")] 13 | [assembly: AssemblyCopyright("Copyright © HP 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7a4368dd-6a09-4c82-ae29-ccad13174c85")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Database_First_Approach.txt: -------------------------------------------------------------------------------- 1 | Here is the link where I have created the web application using Database First Approach (Entity Framework) 2 | Link :- https://github.com/lucy2512/DatabaseFirstAppPK 3 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DatabaseFirstAppPK", "DatabaseFirstAppPK\DatabaseFirstAppPK.csproj", "{3BB95E3D-C4DC-448F-AEDC-CF688CD07616}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3BB95E3D-C4DC-448F-AEDC-CF688CD07616}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3BB95E3D-C4DC-448F-AEDC-CF688CD07616}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3BB95E3D-C4DC-448F-AEDC-CF688CD07616}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3BB95E3D-C4DC-448F-AEDC-CF688CD07616}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {8EF3F417-6606-4C4B-A418-3C02C085E96A} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using DatabaseFirstAppPK.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Diagnostics; 4 | 5 | namespace DatabaseFirstAppPK.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | private readonly ILogger _logger; 10 | 11 | public HomeController(ILogger logger) 12 | { 13 | _logger = logger; 14 | } 15 | 16 | public IActionResult Index() 17 | { 18 | return View(); 19 | } 20 | 21 | public IActionResult Privacy() 22 | { 23 | return View(); 24 | } 25 | 26 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 27 | public IActionResult Error() 28 | { 29 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/DatabaseFirstAppPK.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Models/CarDbContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Microsoft.EntityFrameworkCore; 4 | 5 | namespace DatabaseFirstAppPK.Models; 6 | 7 | public partial class CarDbContext : DbContext 8 | { 9 | public CarDbContext() 10 | { 11 | } 12 | 13 | public CarDbContext(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | public virtual DbSet CarTables { get; set; } 19 | 20 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 21 | #warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see http://go.microsoft.com/fwlink/?LinkId=723263. 22 | => optionsBuilder.UseSqlServer("Server=localhost\\SQLEXPRESS;Database=CarDB;Integrated Security=True;Encrypt = False"); 23 | 24 | protected override void OnModelCreating(ModelBuilder modelBuilder) 25 | { 26 | modelBuilder.Entity(entity => 27 | { 28 | entity.HasKey(e => e.CarId); 29 | 30 | entity.ToTable("Car_Table"); 31 | 32 | entity.Property(e => e.CarId).HasColumnName("carID"); 33 | entity.Property(e => e.CarBrand) 34 | .HasMaxLength(50) 35 | .IsUnicode(false) 36 | .HasColumnName("carBrand"); 37 | entity.Property(e => e.CarModel) 38 | .HasMaxLength(50) 39 | .IsUnicode(false) 40 | .HasColumnName("carModel"); 41 | entity.Property(e => e.CarPrice) 42 | .HasMaxLength(10) 43 | .IsFixedLength() 44 | .HasColumnName("carPrice"); 45 | }); 46 | 47 | OnModelCreatingPartial(modelBuilder); 48 | } 49 | 50 | partial void OnModelCreatingPartial(ModelBuilder modelBuilder); 51 | } 52 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Models/CarTable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace DatabaseFirstAppPK.Models; 5 | 6 | public partial class CarTable 7 | { 8 | public int CarId { get; set; } 9 | 10 | public string? CarBrand { get; set; } 11 | 12 | public string? CarModel { get; set; } 13 | 14 | public string? CarPrice { get; set; } 15 | } 16 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace DatabaseFirstAppPK.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Program.cs: -------------------------------------------------------------------------------- 1 | using DatabaseFirstAppPK.Models; 2 | using Microsoft.EntityFrameworkCore; 3 | 4 | var builder = WebApplication.CreateBuilder(args); 5 | 6 | // Add services to the container. 7 | builder.Services.AddControllersWithViews(); 8 | builder.Services.AddDbContext(options => 9 | options.UseSqlServer(builder.Configuration.GetConnectionString("DBConnection"))); 10 | 11 | var app = builder.Build(); 12 | 13 | // Configure the HTTP request pipeline. 14 | if (!app.Environment.IsDevelopment()) 15 | { 16 | app.UseExceptionHandler("/Home/Error"); 17 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 18 | app.UseHsts(); 19 | } 20 | 21 | app.UseHttpsRedirection(); 22 | app.UseStaticFiles(); 23 | 24 | app.UseRouting(); 25 | 26 | app.UseAuthorization(); 27 | 28 | app.MapControllerRoute( 29 | name: "default", 30 | pattern: "{controller=Home}/{action=Index}/{id?}"); 31 | 32 | app.Run(); 33 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:64379", 7 | "sslPort": 44397 8 | } 9 | }, 10 | "profiles": { 11 | "DatabaseFirstAppPK": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "https://localhost:7294;http://localhost:5294", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Car/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model DatabaseFirstAppPK.Models.CarTable 2 | 3 | @{ 4 | ViewData["Title"] = "Create"; 5 | } 6 | 7 |

Create

8 | 9 |

CarTable

10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 |
26 | 27 | 28 | 29 |
30 |
31 | 32 |
33 |
34 |
35 |
36 | 37 |
38 | Back to List 39 |
40 | 41 | @section Scripts { 42 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 43 | } 44 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Car/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model DatabaseFirstAppPK.Models.CarTable 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

CarTable

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.CarBrand) 16 |
17 |
18 | @Html.DisplayFor(model => model.CarBrand) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.CarModel) 22 |
23 |
24 | @Html.DisplayFor(model => model.CarModel) 25 |
26 |
27 | @Html.DisplayNameFor(model => model.CarPrice) 28 |
29 |
30 | @Html.DisplayFor(model => model.CarPrice) 31 |
32 |
33 | 34 |
35 | 36 | | 37 | Back to List 38 |
39 |
40 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Car/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model DatabaseFirstAppPK.Models.CarTable 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

CarTable

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.CarBrand) 15 |
16 |
17 | @Html.DisplayFor(model => model.CarBrand) 18 |
19 |
20 | @Html.DisplayNameFor(model => model.CarModel) 21 |
22 |
23 | @Html.DisplayFor(model => model.CarModel) 24 |
25 |
26 | @Html.DisplayNameFor(model => model.CarPrice) 27 |
28 |
29 | @Html.DisplayFor(model => model.CarPrice) 30 |
31 |
32 |
33 |
34 | Edit | 35 | Back to List 36 |
37 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Car/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model DatabaseFirstAppPK.Models.CarTable 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | } 6 | 7 |

Edit

8 | 9 |

CarTable

10 |
11 |
12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 | 20 |
21 |
22 | 23 | 24 | 25 |
26 |
27 | 28 | 29 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 | 38 |
39 | Back to List 40 |
41 | 42 | @section Scripts { 43 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 44 | } 45 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Car/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | Create New 11 |

12 | 13 | 14 | 15 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | @foreach (var item in Model) { 29 | 30 | 33 | 36 | 39 | 44 | 45 | } 46 | 47 |
16 | @Html.DisplayNameFor(model => model.CarBrand) 17 | 19 | @Html.DisplayNameFor(model => model.CarModel) 20 | 22 | @Html.DisplayNameFor(model => model.CarPrice) 23 |
31 | @Html.DisplayFor(modelItem => item.CarBrand) 32 | 34 | @Html.DisplayFor(modelItem => item.CarModel) 35 | 37 | @Html.DisplayFor(modelItem => item.CarPrice) 38 | 40 | Edit | 41 | Details | 42 | Delete 43 |
48 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Shared/_Layout.cshtml.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | a { 11 | color: #0077cc; 12 | } 13 | 14 | .btn-primary { 15 | color: #fff; 16 | background-color: #1b6ec2; 17 | border-color: #1861ac; 18 | } 19 | 20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 21 | color: #fff; 22 | background-color: #1b6ec2; 23 | border-color: #1861ac; 24 | } 25 | 26 | .border-top { 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | .border-bottom { 30 | border-bottom: 1px solid #e5e5e5; 31 | } 32 | 33 | .box-shadow { 34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 35 | } 36 | 37 | button.accept-policy { 38 | font-size: 1rem; 39 | line-height: inherit; 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | white-space: nowrap; 47 | line-height: 60px; 48 | } 49 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using DatabaseFirstAppPK 2 | @using DatabaseFirstAppPK.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "DBConnection": "Server=localhost\\SQLEXPRESS;Database=CarDB;Integrated Security=True;Encrypt = False" 11 | 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | 16 | body { 17 | margin-bottom: 60px; 18 | } -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/Database_First_Approach/DatabaseFirstAppPK/wwwroot/favicon.ico -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2021 Twitter, Inc. 4 | Copyright (c) 2011-2021 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Database_First_Approach/DatabaseFirstAppPK/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /Database_First_Approach/Readme.md: -------------------------------------------------------------------------------- 1 | # DatabaseFirstAppPK 2 | ## A MVC application using Database First Approcah (Entity Framework) 3 | ### Step-1 4 | #### Add 3 Dependencies 5 | #### 1.Microsoft.EntityFrameworkCore.SqlServer 6 | #### 2.Microsoft.EntityFrameworkCore.Tools 7 | #### 3.Microsoft.Extensions.Configuration 8 | ### Step-2 9 | #### Add ConnectionString in appsettings.json file 10 | ### Step-3 11 | #### Tools->NuGet Package Manager->Package Manager Control 12 | #### Run Command-> Scaffold-DbContext "Server=DESKTOP-9POA90V\SQLEXPRESS;Database=StudentDB;Integrated Security=True;Encrypt = False" Microsoft.EntityFrameworkCore.SqlServer -OutputDir Models 13 | ### Step-4 14 | #### Add MVC Controller with view, using Entity Framework. 15 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EF_Code_First_Approach", "EF_Code_First_Approach\EF_Code_First_Approach.csproj", "{896882E9-84CF-4D23-8048-53AB3E49B95C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {896882E9-84CF-4D23-8048-53AB3E49B95C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {896882E9-84CF-4D23-8048-53AB3E49B95C}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {896882E9-84CF-4D23-8048-53AB3E49B95C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {896882E9-84CF-4D23-8048-53AB3E49B95C}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {EFACBEF1-7486-4BCB-A2BA-7894E4A33292} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using EF_Code_First_Approach.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Diagnostics; 4 | 5 | namespace EF_Code_First_Approach.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | private readonly ILogger _logger; 10 | 11 | public HomeController(ILogger logger) 12 | { 13 | _logger = logger; 14 | } 15 | 16 | public IActionResult Index() 17 | { 18 | return View(); 19 | } 20 | 21 | public IActionResult Privacy() 22 | { 23 | return View(); 24 | } 25 | 26 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 27 | public IActionResult Error() 28 | { 29 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Data/EF_Code_First_ApproachContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.EntityFrameworkCore; 6 | using EF_Code_First_Approach.Models; 7 | 8 | namespace EF_Code_First_Approach.Data 9 | { 10 | public class EF_Code_First_ApproachContext : DbContext 11 | { 12 | public EF_Code_First_ApproachContext (DbContextOptions options) 13 | : base(options) 14 | { 15 | } 16 | 17 | public DbSet Mobile { get; set; } = default!; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/EF_Code_First_Approach.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | all 17 | runtime; build; native; contentfiles; analyzers; buildtransitive 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Migrations/20221115091541_InitialMigration.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using EF_Code_First_Approach.Data; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | 9 | #nullable disable 10 | 11 | namespace EFCodeFirstApproach.Migrations 12 | { 13 | [DbContext(typeof(EF_Code_First_ApproachContext))] 14 | [Migration("20221115091541_InitialMigration")] 15 | partial class InitialMigration 16 | { 17 | /// 18 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 19 | { 20 | #pragma warning disable 612, 618 21 | modelBuilder 22 | .HasAnnotation("ProductVersion", "7.0.0") 23 | .HasAnnotation("Relational:MaxIdentifierLength", 128); 24 | 25 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); 26 | 27 | modelBuilder.Entity("EF_Code_First_Approach.Models.Mobile", b => 28 | { 29 | b.Property("MobID") 30 | .ValueGeneratedOnAdd() 31 | .HasColumnType("int"); 32 | 33 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("MobID")); 34 | 35 | b.Property("MobBrand") 36 | .HasColumnType("nvarchar(max)"); 37 | 38 | b.Property("MobModel") 39 | .HasColumnType("nvarchar(max)"); 40 | 41 | b.Property("MobPrice") 42 | .HasColumnType("int"); 43 | 44 | b.HasKey("MobID"); 45 | 46 | b.ToTable("Mobile"); 47 | }); 48 | #pragma warning restore 612, 618 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Migrations/20221115091541_InitialMigration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace EFCodeFirstApproach.Migrations 6 | { 7 | /// 8 | public partial class InitialMigration : Migration 9 | { 10 | /// 11 | protected override void Up(MigrationBuilder migrationBuilder) 12 | { 13 | migrationBuilder.CreateTable( 14 | name: "Mobile", 15 | columns: table => new 16 | { 17 | MobID = table.Column(type: "int", nullable: false) 18 | .Annotation("SqlServer:Identity", "1, 1"), 19 | MobBrand = table.Column(type: "nvarchar(max)", nullable: true), 20 | MobModel = table.Column(type: "nvarchar(max)", nullable: true), 21 | MobPrice = table.Column(type: "int", nullable: false) 22 | }, 23 | constraints: table => 24 | { 25 | table.PrimaryKey("PK_Mobile", x => x.MobID); 26 | }); 27 | } 28 | 29 | /// 30 | protected override void Down(MigrationBuilder migrationBuilder) 31 | { 32 | migrationBuilder.DropTable( 33 | name: "Mobile"); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Migrations/EF_Code_First_ApproachContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | // 2 | using EF_Code_First_Approach.Data; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 7 | 8 | #nullable disable 9 | 10 | namespace EFCodeFirstApproach.Migrations 11 | { 12 | [DbContext(typeof(EF_Code_First_ApproachContext))] 13 | partial class EFCodeFirstApproachContextModelSnapshot : ModelSnapshot 14 | { 15 | protected override void BuildModel(ModelBuilder modelBuilder) 16 | { 17 | #pragma warning disable 612, 618 18 | modelBuilder 19 | .HasAnnotation("ProductVersion", "7.0.0") 20 | .HasAnnotation("Relational:MaxIdentifierLength", 128); 21 | 22 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); 23 | 24 | modelBuilder.Entity("EF_Code_First_Approach.Models.Mobile", b => 25 | { 26 | b.Property("MobID") 27 | .ValueGeneratedOnAdd() 28 | .HasColumnType("int"); 29 | 30 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("MobID")); 31 | 32 | b.Property("MobBrand") 33 | .HasColumnType("nvarchar(max)"); 34 | 35 | b.Property("MobModel") 36 | .HasColumnType("nvarchar(max)"); 37 | 38 | b.Property("MobPrice") 39 | .HasColumnType("int"); 40 | 41 | b.HasKey("MobID"); 42 | 43 | b.ToTable("Mobile"); 44 | }); 45 | #pragma warning restore 612, 618 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace EF_Code_First_Approach.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Models/Mobile.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace EF_Code_First_Approach.Models 4 | { 5 | public class Mobile 6 | { 7 | [Key] 8 | public int MobID { get; set; } 9 | public string? MobBrand { get; set; } 10 | public string? MobModel { get; set; } 11 | public int MobPrice { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Program.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using EF_Code_First_Approach.Data; 4 | var builder = WebApplication.CreateBuilder(args); 5 | builder.Services.AddDbContext(options => 6 | options.UseSqlServer(builder.Configuration.GetConnectionString("EF_Code_First_ApproachContext") ?? throw new InvalidOperationException("Connection string 'EF_Code_First_ApproachContext' not found."))); 7 | 8 | // Add services to the container. 9 | builder.Services.AddControllersWithViews(); 10 | 11 | var app = builder.Build(); 12 | 13 | // Configure the HTTP request pipeline. 14 | if (!app.Environment.IsDevelopment()) 15 | { 16 | app.UseExceptionHandler("/Home/Error"); 17 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 18 | app.UseHsts(); 19 | } 20 | 21 | app.UseHttpsRedirection(); 22 | app.UseStaticFiles(); 23 | 24 | app.UseRouting(); 25 | 26 | app.UseAuthorization(); 27 | 28 | app.MapControllerRoute( 29 | name: "default", 30 | pattern: "{controller=Home}/{action=Index}/{id?}"); 31 | 32 | app.Run(); 33 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:1886", 7 | "sslPort": 44301 8 | } 9 | }, 10 | "profiles": { 11 | "EF_Code_First_Approach": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "https://localhost:7004;http://localhost:5004", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mssql1": { 4 | "type": "mssql", 5 | "connectionId": "ConnectionStrings:EF_Code_First_ApproachContext" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mssql1": { 4 | "type": "mssql.local", 5 | "connectionId": "ConnectionStrings:EF_Code_First_ApproachContext" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Mobiles/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model EF_Code_First_Approach.Models.Mobile 2 | 3 | @{ 4 | ViewData["Title"] = "Create"; 5 | } 6 | 7 |

Create

8 | 9 |

Mobile

10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 | 24 |
25 |
26 | 27 | 28 | 29 |
30 |
31 | 32 |
33 |
34 |
35 |
36 | 37 |
38 | Back to List 39 |
40 | 41 | @section Scripts { 42 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 43 | } 44 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Mobiles/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model EF_Code_First_Approach.Models.Mobile 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Mobile

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.MobBrand) 16 |
17 |
18 | @Html.DisplayFor(model => model.MobBrand) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.MobModel) 22 |
23 |
24 | @Html.DisplayFor(model => model.MobModel) 25 |
26 |
27 | @Html.DisplayNameFor(model => model.MobPrice) 28 |
29 |
30 | @Html.DisplayFor(model => model.MobPrice) 31 |
32 |
33 | 34 |
35 | 36 | | 37 | Back to List 38 |
39 |
40 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Mobiles/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model EF_Code_First_Approach.Models.Mobile 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

Mobile

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.MobBrand) 15 |
16 |
17 | @Html.DisplayFor(model => model.MobBrand) 18 |
19 |
20 | @Html.DisplayNameFor(model => model.MobModel) 21 |
22 |
23 | @Html.DisplayFor(model => model.MobModel) 24 |
25 |
26 | @Html.DisplayNameFor(model => model.MobPrice) 27 |
28 |
29 | @Html.DisplayFor(model => model.MobPrice) 30 |
31 |
32 |
33 |
34 | Edit | 35 | Back to List 36 |
37 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Mobiles/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model EF_Code_First_Approach.Models.Mobile 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | } 6 | 7 |

Edit

8 | 9 |

Mobile

10 |
11 |
12 |
13 |
14 |
15 | 16 |
17 | 18 | 19 | 20 |
21 |
22 | 23 | 24 | 25 |
26 |
27 | 28 | 29 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 | 38 |
39 | Back to List 40 |
41 | 42 | @section Scripts { 43 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 44 | } 45 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Mobiles/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | Create New 11 |

12 | 13 | 14 | 15 | 18 | 21 | 24 | 25 | 26 | 27 | 28 | @foreach (var item in Model) { 29 | 30 | 33 | 36 | 39 | 44 | 45 | } 46 | 47 |
16 | @Html.DisplayNameFor(model => model.MobBrand) 17 | 19 | @Html.DisplayNameFor(model => model.MobModel) 20 | 22 | @Html.DisplayNameFor(model => model.MobPrice) 23 |
31 | @Html.DisplayFor(modelItem => item.MobBrand) 32 | 34 | @Html.DisplayFor(modelItem => item.MobModel) 35 | 37 | @Html.DisplayFor(modelItem => item.MobPrice) 38 | 40 | Edit | 41 | Details | 42 | Delete 43 |
48 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Shared/_Layout.cshtml.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | a { 11 | color: #0077cc; 12 | } 13 | 14 | .btn-primary { 15 | color: #fff; 16 | background-color: #1b6ec2; 17 | border-color: #1861ac; 18 | } 19 | 20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 21 | color: #fff; 22 | background-color: #1b6ec2; 23 | border-color: #1861ac; 24 | } 25 | 26 | .border-top { 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | .border-bottom { 30 | border-bottom: 1px solid #e5e5e5; 31 | } 32 | 33 | .box-shadow { 34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 35 | } 36 | 37 | button.accept-policy { 38 | font-size: 1rem; 39 | line-height: inherit; 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | white-space: nowrap; 47 | line-height: 60px; 48 | } 49 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using EF_Code_First_Approach 2 | @using EF_Code_First_Approach.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "ConnectionStrings": { 10 | "EF_Code_First_ApproachContext": "Server=(localdb)\\mssqllocaldb;Database=EF_Code_First_Approach.Data;Trusted_Connection=True;MultipleActiveResultSets=true" 11 | } 12 | } -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | 16 | body { 17 | margin-bottom: 60px; 18 | } -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/EF_Code_First_Approach/EF_Code_First_Approach/wwwroot/favicon.ico -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2021 Twitter, Inc. 4 | Copyright (c) 2011-2021 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/EF_Code_First_Approach/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /EF_Code_First_Approach/Readme.md: -------------------------------------------------------------------------------- 1 | # EF_Code_First_Approach 2 | ## A MVC application using Code First Approcah (Entity Framework) 3 | ### Step-1 4 | #### Add 2 Dependencies 5 | #### 1.Microsoft.EntityFrameworkCore.SqlServer 6 | #### 2.Microsoft.EntityFrameworkCore.Design 7 | ### Step-2 8 | #### Add Model Class for table attributes 9 | ### Step-3 10 | #### (for Migration)Tools->NuGet Package Manager->Package Manager Control 11 | #### Run Command-> 1.Add-Migration InitialMigration 2.Update-Database 12 | ### Step-4 13 | #### Add MVC Controller with view, using Entity Framework 14 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EMP_SAL_CALCULATOR", "EMP_SAL_CALCULATOR\EMP_SAL_CALCULATOR.csproj", "{2B058957-F4E1-464B-A0C3-894909B36507}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2B058957-F4E1-464B-A0C3-894909B36507}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2B058957-F4E1-464B-A0C3-894909B36507}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2B058957-F4E1-464B-A0C3-894909B36507}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {2B058957-F4E1-464B-A0C3-894909B36507}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {C31A85FD-EAB7-4E69-A7A7-C4DB851B50BD} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using EMP_SAL_CALCULATOR.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Diagnostics; 4 | 5 | namespace EMP_SAL_CALCULATOR.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | private readonly ILogger _logger; 10 | 11 | public HomeController(ILogger logger) 12 | { 13 | _logger = logger; 14 | } 15 | 16 | public IActionResult Index() 17 | { 18 | return View(); 19 | } 20 | 21 | public IActionResult Privacy() 22 | { 23 | return View(); 24 | } 25 | 26 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 27 | public IActionResult Error() 28 | { 29 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Controllers/SalaryController.cs: -------------------------------------------------------------------------------- 1 | using EMP_SAL_CALCULATOR.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace EMP_SAL_CALCULATOR.Controllers 5 | { 6 | public class SalaryController : Controller 7 | { 8 | public IActionResult Index() 9 | { 10 | return View(new SalDet()); 11 | } 12 | 13 | 14 | [HttpPost] 15 | public ActionResult Index(SalDet s) 16 | { 17 | if (s.Salary > 100000) 18 | { 19 | s.Tax = s.Salary * 20 / 100; 20 | } 21 | else if(s.Salary > 80000) 22 | { 23 | s.Tax = s.Salary * 10 / 100; 24 | } 25 | else if (s.Salary > 60000) 26 | { 27 | s.Tax = s.Salary * 5 / 100; 28 | } 29 | else 30 | { 31 | s.Tax = 0; 32 | } 33 | 34 | s.AccSalary = s.Salary - s.Tax; 35 | return View(s); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace EMP_SAL_CALCULATOR.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Models/SalDet.cs: -------------------------------------------------------------------------------- 1 | namespace EMP_SAL_CALCULATOR.Models 2 | { 3 | public class SalDet 4 | { 5 | public string? EmpName { get; set; } 6 | public float Salary { get; set; } 7 | public float Tax { get; set; } 8 | public float AccSalary { get; set; } 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | // Add services to the container. 4 | builder.Services.AddControllersWithViews(); 5 | 6 | var app = builder.Build(); 7 | 8 | // Configure the HTTP request pipeline. 9 | if (!app.Environment.IsDevelopment()) 10 | { 11 | app.UseExceptionHandler("/Home/Error"); 12 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 13 | app.UseHsts(); 14 | } 15 | 16 | app.UseHttpsRedirection(); 17 | app.UseStaticFiles(); 18 | 19 | app.UseRouting(); 20 | 21 | app.UseAuthorization(); 22 | 23 | app.MapControllerRoute( 24 | name: "default", 25 | pattern: "{controller=Home}/{action=Index}/{id?}"); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:6584", 7 | "sslPort": 44308 8 | } 9 | }, 10 | "profiles": { 11 | "EMP_SAL_CALCULATOR": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "https://localhost:7025;http://localhost:5025", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Views/Salary/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model EMP_SAL_CALCULATOR.Models.SalDet 2 | 3 | 4 | @{ 5 | ViewBag.Title="Index"; 6 | } 7 | 8 | 9 | 10 | 11 | 12 | 13 |

SALARY CALCULATOR

14 |
15 | @using(Html.BeginForm("/Index","Salary",FormMethod.Post)) 16 | { 17 |
18 | Employee Name 19 | 20 |
21 |
22 |
23 | Base Salary 24 | 25 |
26 |
27 |
28 | Tax 29 | 30 |
31 |
32 |
33 | Acctual Salary 34 | 35 |
36 |
37 | 38 | 39 | } 40 | 41 |
42 | 43 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Views/Shared/_Layout.cshtml.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | a { 11 | color: #0077cc; 12 | } 13 | 14 | .btn-primary { 15 | color: #fff; 16 | background-color: #1b6ec2; 17 | border-color: #1861ac; 18 | } 19 | 20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 21 | color: #fff; 22 | background-color: #1b6ec2; 23 | border-color: #1861ac; 24 | } 25 | 26 | .border-top { 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | .border-bottom { 30 | border-bottom: 1px solid #e5e5e5; 31 | } 32 | 33 | .box-shadow { 34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 35 | } 36 | 37 | button.accept-policy { 38 | font-size: 1rem; 39 | line-height: inherit; 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | white-space: nowrap; 47 | line-height: 60px; 48 | } 49 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using EMP_SAL_CALCULATOR 2 | @using EMP_SAL_CALCULATOR.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | 16 | body { 17 | margin-bottom: 60px; 18 | } -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/wwwroot/favicon.ico -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2021 Twitter, Inc. 4 | Copyright (c) 2011-2021 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /EMP_SAL_CALCULATOR/EMP_SAL_CALCULATOR/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FIRSTMVCAPP", "FIRSTMVCAPP\FIRSTMVCAPP.csproj", "{3291A32B-174D-4541-BD12-462221600080}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {3291A32B-174D-4541-BD12-462221600080}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {3291A32B-174D-4541-BD12-462221600080}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {3291A32B-174D-4541-BD12-462221600080}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {3291A32B-174D-4541-BD12-462221600080}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {964E711F-1D84-466E-85C9-97C4FE4AD155} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Controllers/GetEmpDataController.cs: -------------------------------------------------------------------------------- 1 | using FIRSTMVCAPP.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace FIRSTMVCAPP.Controllers 5 | { 6 | public class GetEmpDataController : Controller 7 | { 8 | //Static Part 9 | /*public IActionResult ShowEmpData() 10 | { 11 | Models.GetEmpData getEmpData = new Models.GetEmpData(); 12 | Employee employee = getEmpData.GetEmpDet(); 13 | return View(employee); 14 | }*/ 15 | 16 | //Dynamic Part 17 | public IActionResult ShowEmpDet(int id,string name,string title,int sal) 18 | { 19 | Employee emp = new Employee(); 20 | emp.empID = id; 21 | emp.empName = name; 22 | emp.empTitle = title; 23 | emp.empSal = sal; 24 | return View(emp); 25 | } 26 | public IActionResult GetEmpDet() 27 | { 28 | return View(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using FIRSTMVCAPP.Models; 2 | using Microsoft.AspNetCore.Mvc; 3 | using System.Diagnostics; 4 | 5 | namespace FIRSTMVCAPP.Controllers 6 | { 7 | public class HomeController : Controller 8 | { 9 | private readonly ILogger _logger; 10 | 11 | public HomeController(ILogger logger) 12 | { 13 | _logger = logger; 14 | } 15 | 16 | public IActionResult Index() 17 | { 18 | return View(); 19 | } 20 | 21 | public IActionResult Privacy() 22 | { 23 | return View(); 24 | } 25 | 26 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 27 | public IActionResult Error() 28 | { 29 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Controllers/TestController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace FIRSTMVCAPP.Controllers 4 | { 5 | public class TestController : Controller 6 | { 7 | public ActionResult Message() 8 | { 9 | return View("Message"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/FIRSTMVCAPP.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Models/Employee.cs: -------------------------------------------------------------------------------- 1 | namespace FIRSTMVCAPP.Models 2 | { 3 | public class Employee 4 | { 5 | public int empID { get; set; } 6 | public string? empName { get; set; } 7 | public string? empTitle { get; set; } 8 | public int empSal { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | namespace FIRSTMVCAPP.Models 2 | { 3 | public class ErrorViewModel 4 | { 5 | public string? RequestId { get; set; } 6 | 7 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 8 | } 9 | } -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Models/GetEmpData.cs: -------------------------------------------------------------------------------- 1 | namespace FIRSTMVCAPP.Models 2 | { 3 | public class GetEmpData 4 | { 5 | //Static Part 6 | /*public Employee GetEmpDet() 7 | { 8 | Employee emp = new Employee(); 9 | emp.empID = 01; 10 | emp.empName = "Parthib"; 11 | emp.empTitle = "SDE"; 12 | emp.empSal = 90000; 13 | return emp; 14 | }*/ 15 | 16 | //Dynamic Part 17 | public Employee GetEmpDet(int id,string name,string titile,int sal) 18 | { 19 | Employee emp = new Employee(); 20 | emp.empID = id; 21 | emp.empName = name; 22 | emp.empTitle = titile; 23 | emp.empSal = sal; 24 | return emp; 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | // Add services to the container. 4 | builder.Services.AddControllersWithViews(); 5 | 6 | var app = builder.Build(); 7 | 8 | // Configure the HTTP request pipeline. 9 | if (!app.Environment.IsDevelopment()) 10 | { 11 | app.UseExceptionHandler("/Home/Error"); 12 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 13 | app.UseHsts(); 14 | } 15 | 16 | app.UseHttpsRedirection(); 17 | app.UseStaticFiles(); 18 | 19 | app.UseRouting(); 20 | 21 | app.UseAuthorization(); 22 | 23 | app.MapControllerRoute( 24 | name: "default", 25 | pattern: "{controller=Home}/{action=Index}/{id?}"); 26 | 27 | app.Run(); 28 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:62500", 7 | "sslPort": 44394 8 | } 9 | }, 10 | "profiles": { 11 | "FIRSTMVCAPP": { 12 | "commandName": "Project", 13 | "dotnetRunMessages": true, 14 | "launchBrowser": true, 15 | "applicationUrl": "https://localhost:7285;http://localhost:5285", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "IIS Express": { 21 | "commandName": "IISExpress", 22 | "launchBrowser": true, 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development" 25 | } 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/GetEmpData/GetEmpDet.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = null; 3 | } 4 | 5 |
6 |
7 | Enter Employee ID:
8 | 9 |
10 | Enter Employee Name:
11 | 12 |
13 | Enter Employee Title:
14 | 15 |
16 | Enter Employee Salary:
17 | 18 |
19 |
20 | 21 |
22 |
23 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/GetEmpData/ShowEmpData.cshtml: -------------------------------------------------------------------------------- 1 | @model FIRSTMVCAPP.Models.Employee; 2 | 3 | 4 |
5 | EmployeeID : @Model.empID; 6 | EmployeeName : @Model.empName; 7 | EmployeeTitle : @Model.empTitle; 8 | EmployeeSalary : @Model.empSal; 9 |
10 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/GetEmpData/ShowEmpDet.cshtml: -------------------------------------------------------------------------------- 1 | @model FIRSTMVCAPP.Models.Employee 2 | 3 | 4 |
5 | EmployeeID: @Model.empID 6 |
7 | EmployeeName: @Model.empName 8 |
9 | EmployeeTitle: @Model.empTitle 10 |
11 | EmployeeSalary: @Model.empSal 12 |
13 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

Welcome

7 |

Learn about building Web apps with ASP.NET Core.

8 |
9 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/Home/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Privacy Policy"; 3 | } 4 |

@ViewData["Title"]

5 | 6 |

Use this page to detail your site's privacy policy.

7 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/Shared/Error.cshtml: -------------------------------------------------------------------------------- 1 | @model ErrorViewModel 2 | @{ 3 | ViewData["Title"] = "Error"; 4 | } 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (Model.ShowRequestId) 10 | { 11 |

12 | Request ID: @Model.RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/Shared/_Layout.cshtml.css: -------------------------------------------------------------------------------- 1 | /* Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | for details on configuring this project to bundle and minify static web assets. */ 3 | 4 | a.navbar-brand { 5 | white-space: normal; 6 | text-align: center; 7 | word-break: break-all; 8 | } 9 | 10 | a { 11 | color: #0077cc; 12 | } 13 | 14 | .btn-primary { 15 | color: #fff; 16 | background-color: #1b6ec2; 17 | border-color: #1861ac; 18 | } 19 | 20 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 21 | color: #fff; 22 | background-color: #1b6ec2; 23 | border-color: #1861ac; 24 | } 25 | 26 | .border-top { 27 | border-top: 1px solid #e5e5e5; 28 | } 29 | .border-bottom { 30 | border-bottom: 1px solid #e5e5e5; 31 | } 32 | 33 | .box-shadow { 34 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 35 | } 36 | 37 | button.accept-policy { 38 | font-size: 1rem; 39 | line-height: inherit; 40 | } 41 | 42 | .footer { 43 | position: absolute; 44 | bottom: 0; 45 | width: 100%; 46 | white-space: nowrap; 47 | line-height: 60px; 48 | } 49 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/Test/Message.cshtml: -------------------------------------------------------------------------------- 1 |  2 |
3 | First MVC application developed by Parthib 4 |
5 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using FIRSTMVCAPP 2 | @using FIRSTMVCAPP.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | html { 2 | font-size: 14px; 3 | } 4 | 5 | @media (min-width: 768px) { 6 | html { 7 | font-size: 16px; 8 | } 9 | } 10 | 11 | html { 12 | position: relative; 13 | min-height: 100%; 14 | } 15 | 16 | body { 17 | margin-bottom: 60px; 18 | } -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/FIRSTMVCAPP/FIRSTMVCAPP/wwwroot/favicon.ico -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification 2 | // for details on configuring this project to bundle and minify static web assets. 3 | 4 | // Write your JavaScript code. 5 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2021 Twitter, Inc. 4 | Copyright (c) 2011-2021 The Bootstrap Authors 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) .NET Foundation. All rights reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not use 4 | these files except in compliance with the License. You may obtain a copy of the 5 | License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software distributed 10 | under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 11 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 12 | specific language governing permissions and limitations under the License. 13 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/wwwroot/lib/jquery-validation/LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | ===================== 3 | 4 | Copyright Jörn Zaefferer 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /FIRSTMVCAPP/FIRSTMVCAPP/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright JS Foundation and other contributors, https://js.foundation/ 2 | 3 | This software consists of voluntary contributions made by many 4 | individuals. For exact contribution history, see the revision history 5 | available at https://github.com/jquery/jquery 6 | 7 | The following license applies to all parts of this software except as 8 | documented below: 9 | 10 | ==== 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining 13 | a copy of this software and associated documentation files (the 14 | "Software"), to deal in the Software without restriction, including 15 | without limitation the rights to use, copy, modify, merge, publish, 16 | distribute, sublicense, and/or sell copies of the Software, and to 17 | permit persons to whom the Software is furnished to do so, subject to 18 | the following conditions: 19 | 20 | The above copyright notice and this permission notice shall be 21 | included in all copies or substantial portions of the Software. 22 | 23 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 24 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 25 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 26 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 27 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 28 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 29 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 30 | 31 | ==== 32 | 33 | All files located in the node_modules and external directories are 34 | externally maintained libraries used by this software which have their 35 | own licenses; we recommend you read them, as their terms may differ from 36 | the terms above. 37 | -------------------------------------------------------------------------------- /FIRST_MVC_APP.txt: -------------------------------------------------------------------------------- 1 | The link for my first MVC APP which I have developed on 07/11/22 during lab session 2 | https://github.com/lucy2512/FIRSTMVCAPP 3 | -------------------------------------------------------------------------------- /FirstApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FirstApp", "FirstApp\FirstApp.csproj", "{71EE722A-4699-4CFB-A4FA-96E914120D5A}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp1", "ConsoleApp1\ConsoleApp1.csproj", "{FBF0C019-A96E-4EB0-BDB0-521A2417DD9E}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2\ConsoleApp2.csproj", "{7A4368DD-6A09-4C82-AE29-CCAD13174C85}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {71EE722A-4699-4CFB-A4FA-96E914120D5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {71EE722A-4699-4CFB-A4FA-96E914120D5A}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {71EE722A-4699-4CFB-A4FA-96E914120D5A}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {71EE722A-4699-4CFB-A4FA-96E914120D5A}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {FBF0C019-A96E-4EB0-BDB0-521A2417DD9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {FBF0C019-A96E-4EB0-BDB0-521A2417DD9E}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {FBF0C019-A96E-4EB0-BDB0-521A2417DD9E}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {FBF0C019-A96E-4EB0-BDB0-521A2417DD9E}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {7A4368DD-6A09-4C82-AE29-CCAD13174C85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {7A4368DD-6A09-4C82-AE29-CCAD13174C85}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {7A4368DD-6A09-4C82-AE29-CCAD13174C85}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {7A4368DD-6A09-4C82-AE29-CCAD13174C85}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {BD18A916-66DB-45BF-8B9B-636F44872E99} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /FirstApp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /FirstApp/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("FirstApp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("HP")] 12 | [assembly: AssemblyProduct("FirstApp")] 13 | [assembly: AssemblyCopyright("Copyright © HP 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("71ee722a-4699-4cfb-a4fa-96e914120d5a")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /LICENCE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Parthib Sarkar 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Labday21-10-22/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Labday21-10-22/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Labday21_10_22 8 | { 9 | internal class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | Bank obj = new Bank(); 14 | obj.Assign(); 15 | obj.WithDraw(); 16 | obj.Deposite(); 17 | obj.ShowData(); 18 | 19 | } 20 | } 21 | class Bank 22 | { 23 | string depositor; 24 | int AcNum, WiAm, Balance; 25 | 26 | public void Assign() 27 | { 28 | Console.WriteLine("Enter Depositor Name: "); 29 | this.depositor= Console.ReadLine(); 30 | Console.WriteLine("Enter Account Number: "); 31 | this.AcNum = Int32.Parse(Console.ReadLine()); 32 | Console.WriteLine("Enter Balance: "); 33 | this.Balance = Int32.Parse(Console.ReadLine()); 34 | 35 | } 36 | public void Deposite() 37 | { 38 | Console.WriteLine("Enter Deposite Amount: "); 39 | int n = Int32.Parse(Console.ReadLine()); 40 | this.Balance += n; 41 | int p = this.Balance; 42 | Console.WriteLine("Current Balance is: " + this.Balance); 43 | } 44 | 45 | public void WithDraw() 46 | { 47 | Console.WriteLine("Enter Withdraw Amount: "); 48 | this.WiAm = Int32.Parse(Console.ReadLine()); 49 | this.Balance -= this.WiAm; 50 | Console.WriteLine("Balance after withdraw: " + this.Balance); 51 | } 52 | 53 | public void ShowData() 54 | { 55 | Console.WriteLine("Name of Depositor is: " + depositor); 56 | Console.WriteLine("Current Balance is: "); 57 | } 58 | 59 | 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /Labday21-10-22/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("Labday21-10-22")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("HP")] 12 | [assembly: AssemblyProduct("Labday21-10-22")] 13 | [assembly: AssemblyCopyright("Copyright © HP 2022")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("ad8ba7b1-ee2b-4e7c-b409-d18239f1eeaf")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /Parthib_Kumar_Sarkar_DotNET(Theory Exam).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/Parthib_Kumar_Sarkar_DotNET(Theory Exam).pdf -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RolebasedJWTbyParthib", "RoleJWT\RolebasedJWTbyParthib.csproj", "{46583031-A3F5-4266-9644-3D8E135D1778}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {46583031-A3F5-4266-9644-3D8E135D1778}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {46583031-A3F5-4266-9644-3D8E135D1778}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {46583031-A3F5-4266-9644-3D8E135D1778}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {46583031-A3F5-4266-9644-3D8E135D1778}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {477ADE73-6432-4148-9E83-48A36D35B1E1} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Controllers/WeatherForecastController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Authorization; 2 | using Microsoft.AspNetCore.Mvc; 3 | 4 | namespace RoleJWT.Controllers 5 | { 6 | [ApiController] 7 | [Route("[controller]")] 8 | public class WeatherForecastController : ControllerBase 9 | { 10 | private static readonly string[] Summaries = new[] 11 | { 12 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 13 | }; 14 | 15 | private readonly ILogger _logger; 16 | 17 | public WeatherForecastController(ILogger logger) 18 | { 19 | _logger = logger; 20 | } 21 | 22 | 23 | [HttpGet(Name = "GetWeatherForecast"),Authorize(Roles = "Admin")] 24 | public IEnumerable Get() 25 | { 26 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 27 | { 28 | Date = DateTime.Now.AddDays(index), 29 | TemperatureC = Random.Shared.Next(-20, 55), 30 | Summary = Summaries[Random.Shared.Next(Summaries.Length)] 31 | }) 32 | .ToArray(); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Data/ApplicationDBContext.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.EntityFrameworkCore; 6 | using RoleJWT.Models; 7 | 8 | namespace RoleJWT.Data 9 | { 10 | public class ApplicationDBContext : DbContext 11 | { 12 | public ApplicationDBContext (DbContextOptions options) 13 | : base(options) 14 | { 15 | } 16 | 17 | public DbSet User { get; set; } = default!; 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Migrations/20230104064705_SecondMigration.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | using RoleJWT.Data; 9 | 10 | #nullable disable 11 | 12 | namespace RoleJWT.Migrations 13 | { 14 | [DbContext(typeof(ApplicationDBContext))] 15 | [Migration("20230104064705_SecondMigration")] 16 | partial class SecondMigration 17 | { 18 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 19 | { 20 | #pragma warning disable 612, 618 21 | modelBuilder 22 | .HasAnnotation("ProductVersion", "6.0.12") 23 | .HasAnnotation("Relational:MaxIdentifierLength", 128); 24 | 25 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); 26 | 27 | modelBuilder.Entity("RoleJWT.Models.User", b => 28 | { 29 | b.Property("Id") 30 | .ValueGeneratedOnAdd() 31 | .HasColumnType("int"); 32 | 33 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); 34 | 35 | b.Property("PasswordHash") 36 | .IsRequired() 37 | .HasColumnType("varbinary(max)"); 38 | 39 | b.Property("PasswordSalt") 40 | .IsRequired() 41 | .HasColumnType("varbinary(max)"); 42 | 43 | b.Property("Role") 44 | .IsRequired() 45 | .HasColumnType("nvarchar(max)"); 46 | 47 | b.Property("UserName") 48 | .IsRequired() 49 | .HasColumnType("nvarchar(max)"); 50 | 51 | b.HasKey("Id"); 52 | 53 | b.ToTable("User"); 54 | }); 55 | #pragma warning restore 612, 618 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Migrations/20230104064705_SecondMigration.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore.Migrations; 3 | 4 | #nullable disable 5 | 6 | namespace RoleJWT.Migrations 7 | { 8 | public partial class SecondMigration : Migration 9 | { 10 | protected override void Up(MigrationBuilder migrationBuilder) 11 | { 12 | migrationBuilder.CreateTable( 13 | name: "User", 14 | columns: table => new 15 | { 16 | Id = table.Column(type: "int", nullable: false) 17 | .Annotation("SqlServer:Identity", "1, 1"), 18 | UserName = table.Column(type: "nvarchar(max)", nullable: false), 19 | Role = table.Column(type: "nvarchar(max)", nullable: false), 20 | PasswordHash = table.Column(type: "varbinary(max)", nullable: false), 21 | PasswordSalt = table.Column(type: "varbinary(max)", nullable: false) 22 | }, 23 | constraints: table => 24 | { 25 | table.PrimaryKey("PK_User", x => x.Id); 26 | }); 27 | } 28 | 29 | protected override void Down(MigrationBuilder migrationBuilder) 30 | { 31 | migrationBuilder.DropTable( 32 | name: "User"); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Migrations/20230105091732_ThirdMigration.Designer.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Migrations; 7 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 8 | using RoleJWT.Data; 9 | 10 | #nullable disable 11 | 12 | namespace RoleJWT.Migrations 13 | { 14 | [DbContext(typeof(ApplicationDBContext))] 15 | [Migration("20230105091732_ThirdMigration")] 16 | partial class ThirdMigration 17 | { 18 | protected override void BuildTargetModel(ModelBuilder modelBuilder) 19 | { 20 | #pragma warning disable 612, 618 21 | modelBuilder 22 | .HasAnnotation("ProductVersion", "6.0.12") 23 | .HasAnnotation("Relational:MaxIdentifierLength", 128); 24 | 25 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); 26 | 27 | modelBuilder.Entity("RoleJWT.Models.User", b => 28 | { 29 | b.Property("Id") 30 | .ValueGeneratedOnAdd() 31 | .HasColumnType("int"); 32 | 33 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); 34 | 35 | b.Property("Email") 36 | .IsRequired() 37 | .HasColumnType("nvarchar(max)"); 38 | 39 | b.Property("PasswordHash") 40 | .IsRequired() 41 | .HasColumnType("varbinary(max)"); 42 | 43 | b.Property("PasswordSalt") 44 | .IsRequired() 45 | .HasColumnType("varbinary(max)"); 46 | 47 | b.Property("Role") 48 | .IsRequired() 49 | .HasColumnType("nvarchar(max)"); 50 | 51 | b.Property("UserName") 52 | .IsRequired() 53 | .HasColumnType("nvarchar(max)"); 54 | 55 | b.HasKey("Id"); 56 | 57 | b.ToTable("User"); 58 | }); 59 | #pragma warning restore 612, 618 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Migrations/20230105091732_ThirdMigration.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | #nullable disable 4 | 5 | namespace RoleJWT.Migrations 6 | { 7 | public partial class ThirdMigration : Migration 8 | { 9 | protected override void Up(MigrationBuilder migrationBuilder) 10 | { 11 | migrationBuilder.AddColumn( 12 | name: "Email", 13 | table: "User", 14 | type: "nvarchar(max)", 15 | nullable: false, 16 | defaultValue: ""); 17 | } 18 | 19 | protected override void Down(MigrationBuilder migrationBuilder) 20 | { 21 | migrationBuilder.DropColumn( 22 | name: "Email", 23 | table: "User"); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Migrations/ApplicationDBContextModelSnapshot.cs: -------------------------------------------------------------------------------- 1 | // 2 | using System; 3 | using Microsoft.EntityFrameworkCore; 4 | using Microsoft.EntityFrameworkCore.Infrastructure; 5 | using Microsoft.EntityFrameworkCore.Metadata; 6 | using Microsoft.EntityFrameworkCore.Storage.ValueConversion; 7 | using RoleJWT.Data; 8 | 9 | #nullable disable 10 | 11 | namespace RoleJWT.Migrations 12 | { 13 | [DbContext(typeof(ApplicationDBContext))] 14 | partial class ApplicationDBContextModelSnapshot : ModelSnapshot 15 | { 16 | protected override void BuildModel(ModelBuilder modelBuilder) 17 | { 18 | #pragma warning disable 612, 618 19 | modelBuilder 20 | .HasAnnotation("ProductVersion", "6.0.12") 21 | .HasAnnotation("Relational:MaxIdentifierLength", 128); 22 | 23 | SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder, 1L, 1); 24 | 25 | modelBuilder.Entity("RoleJWT.Models.User", b => 26 | { 27 | b.Property("Id") 28 | .ValueGeneratedOnAdd() 29 | .HasColumnType("int"); 30 | 31 | SqlServerPropertyBuilderExtensions.UseIdentityColumn(b.Property("Id"), 1L, 1); 32 | 33 | b.Property("Email") 34 | .IsRequired() 35 | .HasColumnType("nvarchar(max)"); 36 | 37 | b.Property("PasswordHash") 38 | .IsRequired() 39 | .HasColumnType("varbinary(max)"); 40 | 41 | b.Property("PasswordSalt") 42 | .IsRequired() 43 | .HasColumnType("varbinary(max)"); 44 | 45 | b.Property("Role") 46 | .IsRequired() 47 | .HasColumnType("nvarchar(max)"); 48 | 49 | b.Property("UserName") 50 | .IsRequired() 51 | .HasColumnType("nvarchar(max)"); 52 | 53 | b.HasKey("Id"); 54 | 55 | b.ToTable("User"); 56 | }); 57 | #pragma warning restore 612, 618 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Models/AddNewUser.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel.DataAnnotations; 2 | 3 | namespace RoleJWT.Models 4 | { 5 | public class AddNewUser 6 | { 7 | public string UserName { get; set; } 8 | [EmailAddress] 9 | public string Email { get; set; } 10 | public string Role { get; set; } 11 | public string Password { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Models/EditRole.cs: -------------------------------------------------------------------------------- 1 | namespace RoleJWT.Models 2 | { 3 | public class EditRole 4 | { 5 | public string Role { get; set; } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Models/Login.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Build.Framework; 2 | using System.ComponentModel; 3 | 4 | namespace RoleJWT.Models 5 | { 6 | public class Login 7 | { 8 | [Required] 9 | public string UserName { get; set; } 10 | [PasswordPropertyText] 11 | public string Password { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Models/Register.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Build.Framework; 2 | using System.ComponentModel; 3 | using System.ComponentModel.DataAnnotations; 4 | using RequiredAttribute = System.ComponentModel.DataAnnotations.RequiredAttribute; 5 | 6 | namespace RoleJWT.Models 7 | { 8 | public class Register 9 | { 10 | [Required] 11 | public string UserName { get; set; } 12 | [EmailAddress] 13 | public string Email { get; set; } 14 | [Required] 15 | public string Role { get; set; } 16 | [PasswordPropertyText] 17 | public string Password { get; set; } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Models/User.cs: -------------------------------------------------------------------------------- 1 | namespace RoleJWT.Models 2 | { 3 | public class User 4 | { 5 | public int Id { get; set; } 6 | public string UserName { get; set; } 7 | public string Email { get; set; } 8 | public string Role { get; set; } = "User"; 9 | public byte[] PasswordHash { get; set; } 10 | 11 | public byte[] PasswordSalt { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:12388", 8 | "sslPort": 44317 9 | } 10 | }, 11 | "profiles": { 12 | "RoleJWT": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "swagger", 17 | "applicationUrl": "https://localhost:7052;http://localhost:5052", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "launchUrl": "swagger", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Properties/serviceDependencies.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mssql1": { 4 | "type": "mssql", 5 | "connectionId": "ConnectionStrings:ApplicationDBContext" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/Properties/serviceDependencies.local.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "mssql1": { 4 | "type": "mssql.local", 5 | "connectionId": "ConnectionStrings:ApplicationDBContext" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/RolebasedJWTbyParthib.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | all 15 | runtime; build; native; contentfiles; analyzers; buildtransitive 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace RoleJWT 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /RoleJWTbyParthib/RoleJWT/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*", 9 | "AppSettings": { 10 | "Token": "Bolbonakeykikorbikorene" 11 | }, 12 | "ConnectionStrings": { 13 | "ApplicationDBContext": "Server=(localdb)\\mssqllocaldb;Database=RoleJWT.Data;Trusted_Connection=True;MultipleActiveResultSets=true" 14 | } 15 | } -------------------------------------------------------------------------------- /SQL-LAB/SQLQuery1.sql: -------------------------------------------------------------------------------- 1 | create table salary( 2 | min_sal int, 3 | max_sal int, 4 | dept varchar(10) 5 | ); -------------------------------------------------------------------------------- /SQL-LAB/SQLQuery14.sql: -------------------------------------------------------------------------------- 1 | USE [master] 2 | GO 3 | /****** Object: Trigger [dbo].[limit] Script Date: 02-11-2022 17:20:32 ******/ 4 | SET ANSI_NULLS ON 5 | GO 6 | SET QUOTED_IDENTIFIER ON 7 | GO 8 | -- ============================================= 9 | -- Author: 10 | -- Create date: 11 | -- Description: 12 | -- ============================================= 13 | 14 | ALTER TRIGGER [dbo].[limit] ON [dbo].[employee] 15 | INSTEAD OF INSERT 16 | AS 17 | BEGIN 18 | declare @sal int; 19 | declare @Dept varchar(10); 20 | declare @Max int; 21 | declare @Min int; 22 | 23 | select @sal= salary,@Dept=dept from inserted 24 | select @Max=max_val,@Min=min_val from dbo.emp_salary where dept=@Dept; 25 | 26 | if @sal<@Min 27 | begin 28 | raiserror('Salary is not correct',16,1) 29 | end 30 | else if @sal>@Max 31 | begin 32 | raiserror('Salary is not correct',16,1) 33 | end 34 | else 35 | begin 36 | insert into dbo.employee select * from inserted; 37 | return 38 | end 39 | 40 | 41 | 42 | END 43 | -------------------------------------------------------------------------------- /SQL-LAB/Trigger.sql: -------------------------------------------------------------------------------- 1 | -- ================================================ 2 | -- Template generated from Template Explorer using: 3 | -- Create Trigger (New Menu).SQL 4 | -- 5 | -- Use the Specify Values for Template Parameters 6 | -- command (Ctrl-Shift-M) to fill in the parameter 7 | -- values below. 8 | -- 9 | -- See additional Create Trigger templates for more 10 | -- examples of different Trigger statements. 11 | -- 12 | -- This block of comments will not be included in 13 | -- the definition of the function. 14 | -- ================================================ 15 | SET ANSI_NULLS ON 16 | GO 17 | SET QUOTED_IDENTIFIER ON 18 | GO 19 | -- ============================================= 20 | -- Author: 21 | -- Create date: 22 | -- Description: 23 | -- ============================================= 24 | CREATE TRIGGER [dbo].[limit] ON dbo.employee 25 | INSTEAD OF INSERT 26 | AS 27 | BEGIN 28 | declare @sal int; 29 | declare @Dept varchar(10); 30 | declare @Max int; 31 | declare @Min int; 32 | 33 | select @sal= salary,@Dept=dept from inserted 34 | select @Max=max_val,@Min=min_val from dbo.salary where dept=@Dept; 35 | 36 | if @sal<@Min 37 | begin 38 | insert into dbo.employee select * from inserted; 39 | end 40 | else 41 | begin 42 | raiserror('Salary is not correct',16,1) 43 | return 44 | end 45 | 46 | 47 | 48 | END 49 | GO 50 | 51 | -------------------------------------------------------------------------------- /SQL-LAB/TriggerReal.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lucy2512/DotNet/288a842539d4abd62f4cab7be29bc85f39bdaf60/SQL-LAB/TriggerReal.sql -------------------------------------------------------------------------------- /WEBAPI/WEBAPI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32929.385 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WEBAPI", "WEBAPI\WEBAPI.csproj", "{5B9367C6-60E3-4673-81BB-6C13E68EE11F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {5B9367C6-60E3-4673-81BB-6C13E68EE11F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {5B9367C6-60E3-4673-81BB-6C13E68EE11F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {5B9367C6-60E3-4673-81BB-6C13E68EE11F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {5B9367C6-60E3-4673-81BB-6C13E68EE11F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {9EEBE51C-BA26-464E-B9A0-2CF43C6006E4} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /WEBAPI/WEBAPI/Controllers/TestController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace WEBAPI.Controllers 4 | { 5 | public class TestController : Controller 6 | { 7 | public static List names = new List() { "Parthib", "Rajdeep", "Deb", "Tausif" }; 8 | 9 | //Get Request without id 10 | [Route("/Get")] 11 | [HttpGet] 12 | public IEnumerable Get() 13 | { 14 | return names; 15 | } 16 | 17 | //Get Request with id 18 | [Route("/Get/{id}")] 19 | [HttpGet] 20 | public string Get(int id) 21 | { 22 | return names[id]; 23 | } 24 | 25 | //Post Request 26 | [Route("/Post")] 27 | [HttpPost] 28 | public void Post([FromBody] string value) 29 | { 30 | names.Add(value); 31 | } 32 | 33 | //Delete Request 34 | [Route("/Delete/{id}")] 35 | [HttpDelete] 36 | public void Delete(int id) 37 | { 38 | names.RemoveAt(id); 39 | } 40 | 41 | //Put or Update Request 42 | [Route("/Put/{id}")] 43 | [HttpPut] 44 | public void Put(int id, [FromBody] string value) 45 | { 46 | names[id] = value; 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /WEBAPI/WEBAPI/Controllers/WeatherForecastController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace WEBAPI.Controllers 4 | { 5 | [ApiController] 6 | [Route("[controller]")] 7 | public class WeatherForecastController : ControllerBase 8 | { 9 | private static readonly string[] Summaries = new[] 10 | { 11 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 12 | }; 13 | 14 | private readonly ILogger _logger; 15 | 16 | public WeatherForecastController(ILogger logger) 17 | { 18 | _logger = logger; 19 | } 20 | 21 | [HttpGet(Name = "GetWeatherForecast")] 22 | public IEnumerable Get() 23 | { 24 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 25 | { 26 | Date = DateTime.Now.AddDays(index), 27 | TemperatureC = Random.Shared.Next(-20, 55), 28 | Summary = Summaries[Random.Shared.Next(Summaries.Length)] 29 | }) 30 | .ToArray(); 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /WEBAPI/WEBAPI/Program.cs: -------------------------------------------------------------------------------- 1 | var builder = WebApplication.CreateBuilder(args); 2 | 3 | // Add services to the container. 4 | 5 | builder.Services.AddControllers(); 6 | // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle 7 | builder.Services.AddEndpointsApiExplorer(); 8 | builder.Services.AddSwaggerGen(); 9 | 10 | var app = builder.Build(); 11 | 12 | // Configure the HTTP request pipeline. 13 | if (app.Environment.IsDevelopment()) 14 | { 15 | app.UseSwagger(); 16 | app.UseSwaggerUI(); 17 | } 18 | 19 | app.UseHttpsRedirection(); 20 | 21 | app.UseAuthorization(); 22 | 23 | app.MapControllers(); 24 | 25 | app.Run(); 26 | -------------------------------------------------------------------------------- /WEBAPI/WEBAPI/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:54598", 8 | "sslPort": 44382 9 | } 10 | }, 11 | "profiles": { 12 | "WEBAPI": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "launchUrl": "swagger", 17 | "applicationUrl": "https://localhost:7249;http://localhost:5249", 18 | "environmentVariables": { 19 | "ASPNETCORE_ENVIRONMENT": "Development" 20 | } 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "launchUrl": "swagger", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /WEBAPI/WEBAPI/WEBAPI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net6.0 5 | enable 6 | enable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /WEBAPI/WEBAPI/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | namespace WEBAPI 2 | { 3 | public class WeatherForecast 4 | { 5 | public DateTime Date { get; set; } 6 | 7 | public int TemperatureC { get; set; } 8 | 9 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 10 | 11 | public string? Summary { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /WEBAPI/WEBAPI/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /WEBAPI/WEBAPI/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | }, 8 | "AllowedHosts": "*" 9 | } 10 | --------------------------------------------------------------------------------