├── .gitignore ├── LICENSE ├── README.md ├── assets ├── logo-pequeno.png ├── logo.png └── perfil.png └── sesiones ├── sesion_0 ├── MultiPlatformApp │ ├── MultiPlatformApp.sln │ └── MultiPlatformApp │ │ ├── MultiPlatformApp.csproj │ │ └── Program.cs ├── NetStandardApp │ ├── NetStandardApp.sln │ └── NetStandardApp │ │ ├── Class1.cs │ │ └── NetStandardApp.csproj └── WindowsApp │ ├── WindowsApp.sln │ └── WindowsApp │ ├── App.config │ ├── Program.cs │ ├── Properties │ └── AssemblyInfo.cs │ └── WindowsApp.csproj ├── sesion_01 ├── NetCode27.Sesion01 │ ├── CodeNet27.Sesion01.Ejercicio00 │ │ ├── CodeNet27.Sesion01.Ejercicio00.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio02 │ │ ├── CodeNet27.Sesion01.Ejercicio02.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio03 │ │ ├── CodeNet27.Sesion01.Ejercicio03.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio04 │ │ ├── CodeNet27.Sesion01.Ejercicio04.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio05 │ │ ├── CodeNet27.Sesion01.Ejercicio05.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio06 │ │ ├── CodeNet27.Sesion01.Ejercicio06.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio07 │ │ ├── CodeNet27.Sesion01.Ejercicio07.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio08 │ │ ├── CodeNet27.Sesion01.Ejercicio08.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio09 │ │ ├── CodeNet27.Sesion01.Ejercicio09.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio10 │ │ ├── CodeNet27.Sesion01.Ejercicio10.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio11 │ │ ├── CodeNet27.Sesion01.Ejercicio11.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio12 │ │ ├── CodeNet27.Sesion01.Ejercicio12.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio13 │ │ ├── CodeNet27.Sesion01.Ejercicio13.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.Ejercicio14 │ │ ├── CodeNet27.Sesion01.Ejercicio14.csproj │ │ └── Program.cs │ ├── CodeNet27.Sesion01.sln │ └── CodeNet27.Sesion01 │ │ ├── CodeNet27.Sesion01.Ejercicio01.csproj │ │ └── Program.cs └── NetCode27.VSCode │ ├── .vscode │ ├── launch.json │ └── tasks.json │ ├── NetCode27.VSCode.csproj │ └── Program.cs ├── sesion_03 ├── WebAPINetCode27.sln └── WebAPINetCode27 │ ├── Controllers │ ├── PersonaController.cs │ └── WeatherForecastController.cs │ ├── Model │ └── Persona.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── WeatherForecast.cs │ ├── WebAPINetCode27.csproj │ ├── appsettings.Development.json │ └── appsettings.json ├── sesion_04 ├── DataBase │ └── NetCode27.zip ├── WebAPINetCode27.sln └── WebAPINetCode27 │ ├── Controllers │ ├── PersonaController.cs │ └── WeatherForecastController.cs │ ├── Model │ └── PersonaDTO.cs │ ├── ModelDB │ ├── NetCode27Context.cs │ └── Personas.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── WeatherForecast.cs │ ├── WebAPINetCode27.csproj │ ├── appsettings.Development.json │ └── appsettings.json ├── sesion_05 ├── DataBase │ └── NetCode27.zip ├── WebAPINetCode27.sln └── WebAPINetCode27 │ ├── .config │ └── dotnet-tools.json │ ├── Controllers │ ├── PersonaController.cs │ └── WeatherForecastController.cs │ ├── Model │ └── PersonaDTO.cs │ ├── ModelDB │ ├── NetCode27Context.cs │ └── Personas.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── WeatherForecast.cs │ ├── WebAPINetCode27.csproj │ ├── appsettings.Development.json │ └── appsettings.json ├── sesion_06 - Parte II ├── DataBase │ └── NetCode27.zip ├── MiPrimerAppWeb │ ├── Controllers │ │ ├── HomeController.cs │ │ └── PersonaController.cs │ ├── MiPrimerAppWeb.csproj │ ├── Models │ │ ├── ErrorViewModel.cs │ │ ├── PersonaDTO.cs │ │ └── PersonaViewModel.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Persona │ │ │ ├── Actualizar.cshtml │ │ │ ├── Buscar.cshtml │ │ │ ├── Crear.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── assets │ │ └── Logo_NetCode27.png │ │ ├── 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-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.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 ├── WebAPINetCode27.sln └── WebAPINetCode27 │ ├── .config │ └── dotnet-tools.json │ ├── Controllers │ ├── PersonaController.cs │ └── WeatherForecastController.cs │ ├── CorsAuthorizationFilterFactory.cs │ ├── Model │ └── PersonaDTO.cs │ ├── ModelDB │ ├── NetCode27Context.cs │ └── Personas.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── WeatherForecast.cs │ ├── WebAPINetCode27.csproj │ ├── appsettings.Development.json │ └── appsettings.json ├── sesion_06 ├── DataBase │ └── NetCode27.zip ├── MiPrimerAppWeb │ ├── Controllers │ │ ├── HomeController.cs │ │ └── PersonaController.cs │ ├── MiPrimerAppWeb.csproj │ ├── Models │ │ ├── ErrorViewModel.cs │ │ ├── PersonaDTO.cs │ │ └── PersonaViewModel.cs │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ │ ├── Home │ │ │ ├── Index.cshtml │ │ │ └── Privacy.cshtml │ │ ├── Persona │ │ │ ├── Buscar.cshtml │ │ │ ├── Crear.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ ├── appsettings.Development.json │ ├── appsettings.json │ └── wwwroot │ │ ├── assets │ │ └── Logo_NetCode27.png │ │ ├── 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-reboot.css │ │ │ ├── bootstrap-reboot.css.map │ │ │ ├── bootstrap-reboot.min.css │ │ │ ├── bootstrap-reboot.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ └── js │ │ │ ├── bootstrap.bundle.js │ │ │ ├── bootstrap.bundle.js.map │ │ │ ├── bootstrap.bundle.min.js │ │ │ ├── bootstrap.bundle.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 ├── WebAPINetCode27.sln └── WebAPINetCode27 │ ├── .config │ └── dotnet-tools.json │ ├── Controllers │ ├── PersonaController.cs │ └── WeatherForecastController.cs │ ├── CorsAuthorizationFilterFactory.cs │ ├── Model │ └── PersonaDTO.cs │ ├── ModelDB │ ├── NetCode27Context.cs │ └── Personas.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── WeatherForecast.cs │ ├── WebAPINetCode27.csproj │ ├── appsettings.Development.json │ └── appsettings.json ├── sesion_08 └── NetCode27Process │ ├── .local │ ├── AllDependencies.json │ ├── PackageCache.json │ ├── ProjectSettings.json │ ├── db │ │ └── references.db │ └── nuget.cache.backup │ ├── .objects │ ├── .metadata │ └── .type │ ├── .screenshots │ ├── 7691dab2fb748d742f181a89fa1ace29.png │ ├── bab26a320aa344c86a71b1a74fb56e55.png │ └── cdcaca6a4f2bf6b540a89e7a7f90e102.png │ ├── Archivos │ └── consultaCompras.xlsx │ ├── Main.xaml │ └── project.json ├── sesion_09 └── REFNetCode27 │ ├── .local │ ├── AllDependencies.json │ ├── PackageCache.json │ ├── ProjectSettings.json │ ├── db │ │ └── references.db │ └── nuget.cache.backup │ ├── .objects │ ├── .metadata │ └── .type │ ├── .screenshots │ ├── 33dde57b4ed0aa763b9311574b6c13b4.png │ ├── 3a2c3aad932f78210607d9644739347a.png │ └── 924f187ca2db1c3388a48272c1c9c985.png │ ├── Bussines │ └── Reporte.xaml │ ├── Data │ ├── Config.xlsx │ ├── Input │ │ └── placeholder.txt │ ├── Output │ │ └── placeholder.txt │ ├── ReporteNet.xlsx │ └── Temp │ │ └── placeholder.txt │ ├── Exceptions_Screenshots │ └── placeholder.txt │ ├── Framework │ ├── CloseAllApplications.xaml │ ├── GetTransactionData.xaml │ ├── InitAllApplications.xaml │ ├── InitAllSettings.xaml │ ├── KillAllProcesses.xaml │ ├── RetryCurrentTransaction.xaml │ ├── SetTransactionStatus.xaml │ └── TakeScreenshot.xaml │ ├── Main.xaml │ ├── Process.xaml │ ├── Tests │ ├── RunAllTests.xaml │ ├── RunAllTests_Logging.xaml │ ├── TestLog.txt │ ├── TestWorkflowTemplate.xaml │ └── Tests.xlsx │ └── project.json └── sesion_10 ├── DataBase └── NetCode27.zip ├── MiPrimerAppWeb ├── Controllers │ ├── HomeController.cs │ └── PersonaController.cs ├── MiPrimerAppWeb.csproj ├── Models │ ├── ErrorViewModel.cs │ ├── PersonaDTO.cs │ └── PersonaViewModel.cs ├── Program.cs ├── Properties │ └── launchSettings.json ├── Startup.cs ├── Views │ ├── Home │ │ ├── Index.cshtml │ │ └── Privacy.cshtml │ ├── Persona │ │ ├── Actualizar.cshtml │ │ ├── Buscar.cshtml │ │ ├── Crear.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml ├── appsettings.Development.json ├── appsettings.json └── wwwroot │ ├── assets │ └── Logo_NetCode27.png │ ├── 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-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.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 ├── WebAPINetCode27.sln └── WebAPINetCode27 ├── .config └── dotnet-tools.json ├── Controllers ├── LoginController.cs ├── PersonaController.cs └── WeatherForecastController.cs ├── CorsAuthorizationFilterFactory.cs ├── Model ├── LoginDTO.cs ├── PersonaDTO.cs └── UsuarioDTO.cs ├── ModelDB ├── NetCode27Context.cs └── Personas.cs ├── Program.cs ├── Properties └── launchSettings.json ├── Startup.cs ├── WeatherForecast.cs ├── WebAPINetCode27.csproj ├── appsettings.Development.json └── appsettings.json /assets/logo-pequeno.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/assets/logo-pequeno.png -------------------------------------------------------------------------------- /assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/assets/logo.png -------------------------------------------------------------------------------- /assets/perfil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/assets/perfil.png -------------------------------------------------------------------------------- /sesiones/sesion_0/MultiPlatformApp/MultiPlatformApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiPlatformApp", "MultiPlatformApp\MultiPlatformApp.csproj", "{0C05B5B2-2B3C-4BDC-8F04-E9D16850C926}" 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 | {0C05B5B2-2B3C-4BDC-8F04-E9D16850C926}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {0C05B5B2-2B3C-4BDC-8F04-E9D16850C926}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {0C05B5B2-2B3C-4BDC-8F04-E9D16850C926}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {0C05B5B2-2B3C-4BDC-8F04-E9D16850C926}.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 = {99A5E36E-70A8-4084-8B7D-9D15489EAB87} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /sesiones/sesion_0/MultiPlatformApp/MultiPlatformApp/MultiPlatformApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_0/MultiPlatformApp/MultiPlatformApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MultiPlatformApp 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World NetCode27 From Net Core"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sesiones/sesion_0/NetStandardApp/NetStandardApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetStandardApp", "NetStandardApp\NetStandardApp.csproj", "{DFC16BF8-3212-4D96-A457-032DD998A735}" 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 | {DFC16BF8-3212-4D96-A457-032DD998A735}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DFC16BF8-3212-4D96-A457-032DD998A735}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DFC16BF8-3212-4D96-A457-032DD998A735}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DFC16BF8-3212-4D96-A457-032DD998A735}.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 = {CB390747-C671-4D30-9052-6760617DA589} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /sesiones/sesion_0/NetStandardApp/NetStandardApp/Class1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetStandardApp 4 | { 5 | public class Class1 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World NetCode27 From Net Standard"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sesiones/sesion_0/NetStandardApp/NetStandardApp/NetStandardApp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | Exe 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_0/WindowsApp/WindowsApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsApp", "WindowsApp\WindowsApp.csproj", "{1C3A1F19-5747-4298-9791-59C4EC038AB0}" 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 | {1C3A1F19-5747-4298-9791-59C4EC038AB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {1C3A1F19-5747-4298-9791-59C4EC038AB0}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {1C3A1F19-5747-4298-9791-59C4EC038AB0}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {1C3A1F19-5747-4298-9791-59C4EC038AB0}.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 = {D5055AC9-B2BE-4D46-B512-41542D2D1D11} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /sesiones/sesion_0/WindowsApp/WindowsApp/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /sesiones/sesion_0/WindowsApp/WindowsApp/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 WindowsApp 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | Console.WriteLine("Hello World NetCode27 From Net Framweork!"); 14 | Console.ReadLine(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sesiones/sesion_0/WindowsApp/WindowsApp/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("WindowsApp")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("WindowsApp")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 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("1c3a1f19-5747-4298-9791-59c4ec038ab0")] 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 | -------------------------------------------------------------------------------- /sesiones/sesion_0/WindowsApp/WindowsApp/WindowsApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {1C3A1F19-5747-4298-9791-59C4EC038AB0} 8 | Exe 9 | WindowsApp 10 | WindowsApp 11 | v4.8 12 | 512 13 | true 14 | true 15 | 16 | 17 | AnyCPU 18 | true 19 | full 20 | false 21 | bin\Debug\ 22 | DEBUG;TRACE 23 | prompt 24 | 4 25 | 26 | 27 | AnyCPU 28 | pdbonly 29 | true 30 | bin\Release\ 31 | TRACE 32 | prompt 33 | 4 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio00/CodeNet27.Sesion01.Ejercicio00.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio00/Program.cs: -------------------------------------------------------------------------------- 1 | using ImageToASCCIConverter; 2 | using System; 3 | 4 | namespace CodeNet27.Sesion01.Ejercicio00 5 | { 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | 11 | ServiceLogoNetCode27 service = new ServiceLogoNetCode27(); 12 | service.PrintLogo(); 13 | 14 | Console.WriteLine("Hello World!"); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio02/CodeNet27.Sesion01.Ejercicio02.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio02/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio02 4 | { 5 | class Program 6 | { 7 | //Pedir dos números al usuario por teclado y decir que número es el mayor. 8 | 9 | static void Main(string[] args) 10 | { 11 | 12 | Console.WriteLine("Hola comunidad .NetCode27"); 13 | Console.WriteLine("Introduzca un numero"); 14 | var numero1 = Console.ReadLine(); 15 | Console.WriteLine("Introduzca otro numero"); 16 | var numero2 = Console.ReadLine(); 17 | 18 | //Convertir números 19 | if (int.Parse(numero1) > int.Parse(numero2)) 20 | { 21 | Console.WriteLine(numero1 + " es mayor que " + numero2); 22 | } 23 | else 24 | { 25 | Console.WriteLine(numero2 + " es mayor que " + numero1); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio03/CodeNet27.Sesion01.Ejercicio03.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio03/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio03 4 | { 5 | class Program 6 | { 7 | //Pedir el nombre de la semana al usuario y 8 | //decirle si es fin de semana o no. En caso de error, indicarlo 9 | static void Main(string[] args) 10 | { 11 | Console.WriteLine("Introduce el dia de la semana (lunes, martes,miercoles,jueves,viernes,sabado o domingo"); 12 | string dia = Console.ReadLine(); 13 | 14 | if (dia == "lunes" || dia == "martes" || dia == "miercoles" || dia == "jueves" || dia == "viernes") 15 | { 16 | Console.WriteLine("no es fin de semana"); 17 | Console.ReadKey(); 18 | } 19 | else 20 | { 21 | if (dia == "sabado" || dia == "domingo") 22 | { 23 | Console.WriteLine("Es fin de semana"); 24 | Console.ReadKey(); 25 | } 26 | else 27 | { 28 | Console.WriteLine("No existe el dia introducido"); 29 | Console.ReadKey(); 30 | } 31 | } 32 | 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio04/CodeNet27.Sesion01.Ejercicio04.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio04/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio04 4 | { 5 | class Program 6 | { 7 | //Pedir al usuario el precio de un producto (valor positivo) y la forma de pagar 8 | //(efectivo o tarjeta) si la forma de pago es mediante tarjeta, 9 | //pedir el numero de cuenta (inventado). 10 | static void Main(string[] args) 11 | { 12 | Console.WriteLine("introduzca el valor del producto"); 13 | 14 | //Si no se introduce un numero fallara 15 | var valor = int.Parse(Console.ReadLine()); 16 | Console.WriteLine("efectivo o tarjeta"); 17 | var tipo = Console.ReadLine(); 18 | 19 | if (tipo == "tarjeta") 20 | { 21 | Console.WriteLine("Introduzca el numero de tarjeta"); 22 | var tarjeta = Console.ReadLine(); 23 | 24 | //usamos la interpolacion de cadenas para mostrar el resultado $(" texto {variable}") 25 | Console.WriteLine($"Su tarjeta es {tarjeta}"); 26 | Console.ReadKey(); 27 | } 28 | 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio05/CodeNet27.Sesion01.Ejercicio05.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio05/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio05 4 | { 5 | class Program 6 | { 7 | //Recorre los números del 1 al 100. Usa un bucle for, pintarlos por consola. 8 | 9 | static void Main(string[] args) 10 | { 11 | for (int i = 1; i < 101; i++) 12 | { 13 | Console.WriteLine(i); 14 | } 15 | 16 | Console.ReadKey(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio06/CodeNet27.Sesion01.Ejercicio06.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio06/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio06 4 | { 5 | class Program 6 | { 7 | //Recorre los números del 1 al 100. Usa un bucle while, pintarlos por consola. 8 | static void Main(string[] args) 9 | { 10 | int i = 1; 11 | while (i < 101) 12 | { 13 | Console.WriteLine(i); 14 | i++; // incrementamos la i, tambien se puede usar i = i + 1 15 | } 16 | Console.ReadKey(); 17 | 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio07/CodeNet27.Sesion01.Ejercicio07.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio07/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio07 4 | { 5 | class Program 6 | { 7 | //Recorre los números del 1 al 100. Muestra los números pares. 8 | //Usar el tipo de bucle que quieras. 9 | static void Main(string[] args) 10 | { 11 | for (int i = 1; i < 101; i++) 12 | { 13 | if (i % 2 == 0) 14 | { 15 | Console.WriteLine(i); 16 | } 17 | } 18 | Console.ReadKey(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio08/CodeNet27.Sesion01.Ejercicio08.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio08/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio08 4 | { 5 | class Program 6 | { 7 | //Recorre los números del 1 al 100. Muestra los números pares o divisibles entre 3. 8 | static void Main(string[] args) 9 | { 10 | for (int i = 1; i < 101; i++) 11 | { 12 | if (i % 2 == 0 || i % 3 == 0) 13 | { 14 | Console.WriteLine(i); 15 | } 16 | } 17 | Console.ReadKey(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio09/CodeNet27.Sesion01.Ejercicio09.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio09/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio09 4 | { 5 | class Program 6 | { 7 | //Crea un array e inserta los números pares del 1 al 100 en ese array. 8 | static void Main(string[] args) 9 | { 10 | //inicializamos el array 11 | int[] arrayInt = new int[50]; 12 | 13 | //ponemos el indice a 0 14 | int index = 0; 15 | 16 | //recorremos el bucle comprobando los pares 17 | for (int i = 1; i < 101; i++) 18 | { 19 | //Si es multiplo de 2, ponemos en la posicion del indice el valor del numero 20 | if (i % 2 == 0) 21 | { 22 | arrayInt[index] = i; 23 | 24 | //Incrementamos el valor del indice a indice + 1 25 | index++; 26 | } 27 | } 28 | 29 | //recorremos el array pintando los datos del array 30 | foreach (var numeroPar in arrayInt) 31 | { 32 | Console.WriteLine(numeroPar); 33 | } 34 | 35 | Console.ReadKey(); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio10/CodeNet27.Sesion01.Ejercicio10.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio10/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio10 4 | { 5 | class Program 6 | { 7 | // Pide 10 números por consola, muestra el resultado por consola de sumar los pares y restarle los impares. 8 | static void Main(string[] args) 9 | { 10 | //iniciamos las variables, para ir sumando los valores 11 | int sumaPares = 0; 12 | int sumaImpares = 0; 13 | 14 | //hacemos un bucle for, para pedir los 10 numeros 15 | for (int i = 0; i < 10; i++) 16 | { 17 | Console.WriteLine("Introduce un numero"); 18 | var numero = Console.ReadLine(); 19 | 20 | //como RedLine devuelve un string, hay que convertirlo en entero 21 | int numeroInt = int.Parse(numero); 22 | 23 | //obtenemos si es par o impar, para sumarlo a la variable correspondiente 24 | if (int.Parse(numero) % 2 == 0) 25 | { 26 | sumaPares = sumaPares + numeroInt; 27 | } 28 | else 29 | { 30 | sumaImpares = sumaImpares + numeroInt; 31 | } 32 | } 33 | 34 | Console.WriteLine($"Los pares suman {sumaPares}"); 35 | Console.WriteLine($"Los impares suman {sumaImpares}"); 36 | Console.ReadKey(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio11/CodeNet27.Sesion01.Ejercicio11.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio11/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio11 4 | { 5 | //Crea un programa, que pida un número del 1 al 7,  6 | //devuelva el día de la semana , teniendo en cuenta que el 1 es Lunes, hacer con un switch. 7 | class Program 8 | { 9 | static void Main(string[] args) 10 | { 11 | 12 | Console.WriteLine("introduce un numero de 1 al 7"); 13 | var numero = Console.ReadLine(); 14 | int numeroSemana = int.Parse(numero); 15 | 16 | //comprobamos que el numero este comprendido entre 1 y 7 17 | if (numeroSemana > 7 || numeroSemana < 1) 18 | { 19 | Console.WriteLine("El numero es incorrecto"); 20 | Console.ReadKey(); 21 | } 22 | else 23 | { 24 | switch (numeroSemana) 25 | { 26 | case 1: 27 | Console.WriteLine("Lunes"); 28 | Console.ReadKey(); 29 | break; 30 | case 2: 31 | Console.WriteLine("Martes"); 32 | Console.ReadKey(); 33 | break; 34 | case 3: 35 | Console.WriteLine("Miercoles"); 36 | Console.ReadKey(); 37 | break; 38 | case 4: 39 | Console.WriteLine("Jueves"); 40 | Console.ReadKey(); 41 | break; 42 | case 5: 43 | Console.WriteLine("Viernes"); 44 | Console.ReadKey(); 45 | break; 46 | case 6: 47 | Console.WriteLine("Sabado"); 48 | Console.ReadKey(); 49 | break; 50 | case 7: 51 | Console.WriteLine("Domingo"); 52 | Console.ReadKey(); 53 | break; 54 | default: 55 | break; 56 | } 57 | } 58 | 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio12/CodeNet27.Sesion01.Ejercicio12.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio12/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio12 4 | { 5 | //Crea un programa que pida por consola un numero del 1 al 1000 6 | //(validara que el numero introducido es correcto) y sume todos los números 7 | //del 1 al numero introducido, mostrando por consola el numero de la suma y la media. 0 8 | 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | int suma = 0; 14 | 15 | 16 | Console.WriteLine("Introduce un numero del 1 al 1000"); 17 | var numero = Console.ReadLine(); 18 | int numeroInt = int.Parse(numero); 19 | 20 | 21 | if (numeroInt < 1 || numeroInt > 1000) 22 | { 23 | Console.WriteLine("Introduce un numero del 1 al 1000"); 24 | Console.ReadKey(); 25 | } 26 | for (int i = 1; i < numeroInt + 1; i++) 27 | { 28 | suma = suma + i; 29 | } 30 | 31 | Console.WriteLine($"La suma es {suma}"); 32 | Console.WriteLine($"La media es {suma / numeroInt}"); 33 | Console.ReadKey(); 34 | 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio13/CodeNet27.Sesion01.Ejercicio13.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio13/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio13 4 | { 5 | //Comprobar si un numero introducido por consola es primo 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | int a = 0, i, numero; 11 | Console.WriteLine("Ingrese numero"); 12 | numero = int.Parse(Console.ReadLine()); 13 | 14 | for (i = 1; i < (numero + 1); i++) 15 | { 16 | if (numero % i == 0) 17 | { 18 | a++; 19 | } 20 | } 21 | if (a != 2) 22 | { 23 | Console.WriteLine("No es Primo"); 24 | } 25 | else 26 | { 27 | Console.WriteLine("Si es Primo"); 28 | } 29 | Console.ReadLine(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio14/CodeNet27.Sesion01.Ejercicio14.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01.Ejercicio14/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace CodeNet27.Sesion01.Ejercicio14 4 | { 5 | //Crear un programa calcule cuantas cifras tiene un número entero positivo (pista: se puede hacer dividiendo varias veces entre 10) 6 | class Program 7 | { 8 | static void Main(string[] args) 9 | { 10 | Console.WriteLine("introduce un numero"); 11 | int numero = int.Parse(Console.ReadLine()); 12 | //Creamos una variable float, para que en la division acepte resultados con decimales 13 | float numeroDividido = numero; 14 | //inicalizamos el numero de cifras del numero a 0 15 | int numeroCifras = 0; 16 | 17 | //realizaremos esta accion hasta que la division sea menor que 1 18 | while (numeroDividido > 1) 19 | { 20 | //dividimos el numero entre 10, si el resultado no es menor que 1, sumamos uno al numero de cifras 21 | numeroDividido = numeroDividido / 10; 22 | numeroCifras++; 23 | } 24 | 25 | Console.WriteLine($"El numero tienen {numeroCifras} cifras"); 26 | Console.ReadKey(); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01/CodeNet27.Sesion01.Ejercicio01.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.Sesion01/CodeNet27.Sesion01/Program.cs: -------------------------------------------------------------------------------- 1 | using ImageToASCCIConverter; 2 | using System; 3 | 4 | namespace CodeNet27.Sesion01 5 | { 6 | //Crear 3 variables numéricas con el valor que tu quieras y en otra variable 7 | //numérica guardar el valor de la suma de las 3 anteriores. Mostrar por consola. 8 | class Program 9 | { 10 | static void Main(string[] args) 11 | { 12 | ServiceLogoNetCode27 service = new ServiceLogoNetCode27(); 13 | service.PrintLogo(); 14 | 15 | int numero1 = 10; 16 | int numero2 = 2; 17 | int numero3 = 5; 18 | 19 | 20 | int sumaNumeros = numero3 + numero2 + numero3; 21 | Console.WriteLine("Resultado = " + sumaNumeros); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.VSCode/.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to find out which attributes exist for C# debugging 3 | // Use hover for the description of the existing attributes 4 | // For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": ".NET Core Launch (console)", 9 | "type": "coreclr", 10 | "request": "launch", 11 | "preLaunchTask": "build", 12 | // If you have changed target frameworks, make sure to update the program path. 13 | "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/NetCode27.VSCode.dll", 14 | "args": [], 15 | "cwd": "${workspaceFolder}", 16 | // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console 17 | "console": "internalConsole", 18 | "stopAtEntry": false 19 | }, 20 | { 21 | "name": ".NET Core Attach", 22 | "type": "coreclr", 23 | "request": "attach", 24 | "processId": "${command:pickProcess}" 25 | } 26 | ] 27 | } -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.VSCode/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "build", 6 | "command": "dotnet", 7 | "type": "process", 8 | "args": [ 9 | "build", 10 | "${workspaceFolder}/NetCode27.VSCode.csproj", 11 | "/property:GenerateFullPaths=true", 12 | "/consoleloggerparameters:NoSummary" 13 | ], 14 | "problemMatcher": "$msCompile" 15 | }, 16 | { 17 | "label": "publish", 18 | "command": "dotnet", 19 | "type": "process", 20 | "args": [ 21 | "publish", 22 | "${workspaceFolder}/NetCode27.VSCode.csproj", 23 | "/property:GenerateFullPaths=true", 24 | "/consoleloggerparameters:NoSummary" 25 | ], 26 | "problemMatcher": "$msCompile" 27 | }, 28 | { 29 | "label": "watch", 30 | "command": "dotnet", 31 | "type": "process", 32 | "args": [ 33 | "watch", 34 | "run", 35 | "${workspaceFolder}/NetCode27.VSCode.csproj", 36 | "/property:GenerateFullPaths=true", 37 | "/consoleloggerparameters:NoSummary" 38 | ], 39 | "problemMatcher": "$msCompile" 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.VSCode/NetCode27.VSCode.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /sesiones/sesion_01/NetCode27.VSCode/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetCode27.VSCode 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPINetCode27", "WebAPINetCode27\WebAPINetCode27.csproj", "{D304A2C8-54F9-4A69-9C30-51F76278D234}" 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 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.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 = {00F1CCC2-19F3-4BA4-AF91-A2BB8856A06E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/Controllers/WeatherForecastController.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.Extensions.Logging; 7 | 8 | namespace WebAPINetCode27.Controllers 9 | { 10 | [ApiController] 11 | [Route("[controller]")] 12 | public class WeatherForecastController : ControllerBase 13 | { 14 | private static readonly string[] Summaries = new[] 15 | { 16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 17 | }; 18 | 19 | private readonly ILogger _logger; 20 | 21 | public WeatherForecastController(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | [HttpGet] 27 | public IEnumerable Get() 28 | { 29 | var rng = new Random(); 30 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 31 | { 32 | Date = DateTime.Now.AddDays(index), 33 | TemperatureC = rng.Next(-20, 55), 34 | Summary = Summaries[rng.Next(Summaries.Length)] 35 | }) 36 | .ToArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/Model/Persona.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace WebAPINetCode27.Model 7 | { 8 | public class Persona 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebAPINetCode27 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:58723", 8 | "sslPort": 44314 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "WebAPINetCode27": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Hosting; 12 | using Microsoft.Extensions.Logging; 13 | 14 | namespace WebAPINetCode27 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddControllers(); 29 | } 30 | 31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 32 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 33 | { 34 | if (env.IsDevelopment()) 35 | { 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | 39 | app.UseHttpsRedirection(); 40 | 41 | app.UseRouting(); 42 | 43 | app.UseAuthorization(); 44 | 45 | app.UseEndpoints(endpoints => 46 | { 47 | endpoints.MapControllers(); 48 | }); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/WebAPINetCode27.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_03/WebAPINetCode27/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /sesiones/sesion_04/DataBase/NetCode27.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_04/DataBase/NetCode27.zip -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPINetCode27", "WebAPINetCode27\WebAPINetCode27.csproj", "{D304A2C8-54F9-4A69-9C30-51F76278D234}" 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 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.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 = {00F1CCC2-19F3-4BA4-AF91-A2BB8856A06E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/Controllers/PersonaController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Http; 6 | using Microsoft.AspNetCore.Mvc; 7 | using WebAPINetCode27.Model; 8 | using WebAPINetCode27.ModelDB; 9 | 10 | namespace WebAPINetCode27.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class PersonaController : ControllerBase 15 | { 16 | // GET: api/Persona 17 | [HttpGet] 18 | public IEnumerable Get() 19 | { 20 | 21 | List personas = new List(); 22 | 23 | using(NetCode27Context context = new NetCode27Context()) 24 | { 25 | var entidades = context.Personas; 26 | 27 | foreach (var item in entidades) 28 | { 29 | PersonaDTO p = new PersonaDTO(); 30 | p.ApMaterno = item.ApMaterno; 31 | p.ApPaterno = item.ApPaterno; 32 | p.Edad = item.Edad; 33 | p.Id = item.Id; 34 | p.Nombre = item.Nombre; 35 | 36 | personas.Add(p); 37 | } 38 | 39 | } 40 | 41 | return personas; 42 | } 43 | 44 | // GET: api/Persona/5 45 | [HttpGet("{id}", Name = "Get")] 46 | public PersonaDTO Get(int id) 47 | { 48 | 49 | PersonaDTO p = new PersonaDTO(); 50 | 51 | using (NetCode27Context context = new NetCode27Context()) 52 | { 53 | var item = context.Personas.FirstOrDefault(p=>p.Id == id); 54 | 55 | p.ApMaterno = item.ApMaterno; 56 | p.ApPaterno = item.ApPaterno; 57 | p.Edad = item.Edad; 58 | p.Id = item.Id; 59 | p.Nombre = item.Nombre; 60 | 61 | } 62 | 63 | return p; 64 | 65 | } 66 | 67 | // POST: api/Persona 68 | [HttpPost] 69 | public string Post([FromBody] PersonaDTO value) 70 | { 71 | using (NetCode27Context context = new NetCode27Context()) 72 | { 73 | Personas objectDb = new Personas(); 74 | objectDb.ApMaterno = value.ApMaterno; 75 | objectDb.ApPaterno = value.ApPaterno; 76 | objectDb.Edad = value.Edad; 77 | objectDb.Nombre = value.Nombre; 78 | 79 | context.Personas.Add(objectDb); 80 | context.SaveChanges(); 81 | 82 | } 83 | 84 | return ";) todo ok"; 85 | } 86 | 87 | // PUT: api/Persona/5 88 | [HttpPut("{id}")] 89 | public string Put(int id, [FromBody] PersonaDTO value) 90 | { 91 | using (NetCode27Context context = new NetCode27Context()) 92 | { 93 | var item = context.Personas.FirstOrDefault(p => p.Id == id); 94 | item.ApMaterno = value.ApMaterno; 95 | item.ApPaterno = value.ApPaterno; 96 | item.Edad = value.Edad; 97 | item.Nombre = value.Nombre; 98 | context.SaveChanges(); 99 | 100 | } 101 | 102 | return ";) todo ok"; 103 | 104 | 105 | } 106 | 107 | // DELETE: api/ApiWithActions/5 108 | [HttpDelete("{id}")] 109 | public void Delete(int id) 110 | { 111 | using (NetCode27Context context = new NetCode27Context()) 112 | { 113 | var item = context.Personas.FirstOrDefault(p => p.Id == id); 114 | context.Personas.Remove(item); 115 | context.SaveChanges(); 116 | } 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/Controllers/WeatherForecastController.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.Extensions.Logging; 7 | 8 | namespace WebAPINetCode27.Controllers 9 | { 10 | [ApiController] 11 | [Route("[controller]")] 12 | public class WeatherForecastController : ControllerBase 13 | { 14 | private static readonly string[] Summaries = new[] 15 | { 16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 17 | }; 18 | 19 | private readonly ILogger _logger; 20 | 21 | public WeatherForecastController(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | [HttpGet] 27 | public IEnumerable Get() 28 | { 29 | var rng = new Random(); 30 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 31 | { 32 | Date = DateTime.Now.AddDays(index), 33 | TemperatureC = rng.Next(-20, 55), 34 | Summary = Summaries[rng.Next(Summaries.Length)] 35 | }) 36 | .ToArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/Model/PersonaDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace WebAPINetCode27.Model 7 | { 8 | public class PersonaDTO 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/ModelDB/NetCode27Context.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata; 4 | 5 | namespace WebAPINetCode27.ModelDB 6 | { 7 | public partial class NetCode27Context : DbContext 8 | { 9 | public NetCode27Context() 10 | { 11 | } 12 | 13 | public NetCode27Context(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | public virtual DbSet Personas { get; set; } 19 | 20 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 21 | { 22 | if (!optionsBuilder.IsConfigured) 23 | { 24 | optionsBuilder.UseSqlServer("Server=.;Database=NetCode27;Trusted_Connection=True;"); 25 | } 26 | } 27 | 28 | protected override void OnModelCreating(ModelBuilder modelBuilder) 29 | { 30 | modelBuilder.Entity(entity => 31 | { 32 | entity.Property(e => e.ApMaterno).IsRequired(); 33 | 34 | entity.Property(e => e.ApPaterno).IsRequired(); 35 | 36 | entity.Property(e => e.Nombre).IsRequired(); 37 | }); 38 | 39 | OnModelCreatingPartial(modelBuilder); 40 | } 41 | 42 | partial void OnModelCreatingPartial(ModelBuilder modelBuilder); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/ModelDB/Personas.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace WebAPINetCode27.ModelDB 5 | { 6 | public partial class Personas 7 | { 8 | public int Id { get; set; } 9 | public string Nombre { get; set; } 10 | public string ApPaterno { get; set; } 11 | public string ApMaterno { get; set; } 12 | public int Edad { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebAPINetCode27 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:58723", 8 | "sslPort": 44314 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "WebAPINetCode27": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Hosting; 12 | using Microsoft.Extensions.Logging; 13 | 14 | namespace WebAPINetCode27 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddControllers(); 29 | } 30 | 31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 32 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 33 | { 34 | if (env.IsDevelopment()) 35 | { 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | 39 | app.UseHttpsRedirection(); 40 | 41 | app.UseRouting(); 42 | 43 | app.UseAuthorization(); 44 | 45 | app.UseEndpoints(endpoints => 46 | { 47 | endpoints.MapControllers(); 48 | }); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/WebAPINetCode27.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_04/WebAPINetCode27/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /sesiones/sesion_05/DataBase/NetCode27.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_05/DataBase/NetCode27.zip -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebAPINetCode27", "WebAPINetCode27\WebAPINetCode27.csproj", "{D304A2C8-54F9-4A69-9C30-51F76278D234}" 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 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.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 = {00F1CCC2-19F3-4BA4-AF91-A2BB8856A06E} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "3.1.5", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/Controllers/PersonaController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Http; 6 | using Microsoft.AspNetCore.Mvc; 7 | using WebAPINetCode27.Model; 8 | using WebAPINetCode27.ModelDB; 9 | 10 | namespace WebAPINetCode27.Controllers 11 | { 12 | [Route("api/[controller]")] 13 | [ApiController] 14 | public class PersonaController : ControllerBase 15 | { 16 | // GET: api/Persona 17 | [HttpGet] 18 | public IEnumerable Get() 19 | { 20 | 21 | List personas = new List(); 22 | 23 | using(NetCode27Context context = new NetCode27Context()) 24 | { 25 | var entidades = context.Personas; 26 | 27 | foreach (var item in entidades) 28 | { 29 | PersonaDTO p = new PersonaDTO(); 30 | p.ApMaterno = item.ApMaterno; 31 | p.ApPaterno = item.ApPaterno; 32 | p.Edad = item.Edad; 33 | p.Id = item.Id; 34 | p.Nombre = item.Nombre; 35 | 36 | personas.Add(p); 37 | } 38 | 39 | } 40 | 41 | return personas; 42 | } 43 | 44 | // GET: api/Persona/5 45 | [HttpGet("{id}", Name = "Get")] 46 | public PersonaDTO Get(int id) 47 | { 48 | 49 | PersonaDTO p = new PersonaDTO(); 50 | 51 | using (NetCode27Context context = new NetCode27Context()) 52 | { 53 | var item = context.Personas.FirstOrDefault(p=>p.Id == id); 54 | 55 | p.ApMaterno = item.ApMaterno; 56 | p.ApPaterno = item.ApPaterno; 57 | p.Edad = item.Edad; 58 | p.Id = item.Id; 59 | p.Nombre = item.Nombre; 60 | 61 | } 62 | 63 | return p; 64 | 65 | } 66 | 67 | // POST: api/Persona 68 | [HttpPost] 69 | public string Post([FromBody] PersonaDTO value) 70 | { 71 | using (NetCode27Context context = new NetCode27Context()) 72 | { 73 | Personas objectDb = new Personas(); 74 | objectDb.ApMaterno = value.ApMaterno; 75 | objectDb.ApPaterno = value.ApPaterno; 76 | objectDb.Edad = value.Edad; 77 | objectDb.Nombre = value.Nombre; 78 | 79 | context.Personas.Add(objectDb); 80 | context.SaveChanges(); 81 | 82 | } 83 | 84 | return ";) todo ok"; 85 | } 86 | 87 | // PUT: api/Persona/5 88 | [HttpPut("{id}")] 89 | public string Put(int id, [FromBody] PersonaDTO value) 90 | { 91 | using (NetCode27Context context = new NetCode27Context()) 92 | { 93 | var item = context.Personas.FirstOrDefault(p => p.Id == id); 94 | item.ApMaterno = value.ApMaterno; 95 | item.ApPaterno = value.ApPaterno; 96 | item.Edad = value.Edad; 97 | item.Nombre = value.Nombre; 98 | context.SaveChanges(); 99 | 100 | } 101 | 102 | return ";) todo ok"; 103 | 104 | 105 | } 106 | 107 | // DELETE: api/ApiWithActions/5 108 | [HttpDelete("{id}")] 109 | public void Delete(int id) 110 | { 111 | using (NetCode27Context context = new NetCode27Context()) 112 | { 113 | var item = context.Personas.FirstOrDefault(p => p.Id == id); 114 | context.Personas.Remove(item); 115 | context.SaveChanges(); 116 | } 117 | } 118 | } 119 | } 120 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/Controllers/WeatherForecastController.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.Extensions.Logging; 7 | 8 | namespace WebAPINetCode27.Controllers 9 | { 10 | [ApiController] 11 | [Route("[controller]")] 12 | public class WeatherForecastController : ControllerBase 13 | { 14 | private static readonly string[] Summaries = new[] 15 | { 16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 17 | }; 18 | 19 | private readonly ILogger _logger; 20 | 21 | public WeatherForecastController(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | [HttpGet] 27 | public IEnumerable Get() 28 | { 29 | var rng = new Random(); 30 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 31 | { 32 | Date = DateTime.Now.AddDays(index), 33 | TemperatureC = rng.Next(-20, 55), 34 | Summary = Summaries[rng.Next(Summaries.Length)] 35 | }) 36 | .ToArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/Model/PersonaDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace WebAPINetCode27.Model 7 | { 8 | public class PersonaDTO 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/ModelDB/NetCode27Context.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata; 4 | 5 | namespace WebAPINetCode27.ModelDB 6 | { 7 | public partial class NetCode27Context : DbContext 8 | { 9 | public NetCode27Context() 10 | { 11 | } 12 | 13 | public NetCode27Context(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | public virtual DbSet Personas { get; set; } 19 | 20 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 21 | { 22 | if (!optionsBuilder.IsConfigured) 23 | { 24 | optionsBuilder.UseSqlServer("Server=tcp:netcode27.database.windows.net,1433;Initial Catalog=netcode27;Persist Security Info=False;User ID=netcode27;Password=Comal20-_2019;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"); 25 | } 26 | } 27 | 28 | protected override void OnModelCreating(ModelBuilder modelBuilder) 29 | { 30 | modelBuilder.Entity(entity => 31 | { 32 | entity.Property(e => e.ApMaterno).IsRequired(); 33 | 34 | entity.Property(e => e.ApPaterno).IsRequired(); 35 | 36 | entity.Property(e => e.Nombre).IsRequired(); 37 | }); 38 | 39 | OnModelCreatingPartial(modelBuilder); 40 | } 41 | 42 | partial void OnModelCreatingPartial(ModelBuilder modelBuilder); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/ModelDB/Personas.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace WebAPINetCode27.ModelDB 5 | { 6 | public partial class Personas 7 | { 8 | public int Id { get; set; } 9 | public string Nombre { get; set; } 10 | public string ApPaterno { get; set; } 11 | public string ApMaterno { get; set; } 12 | public int Edad { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebAPINetCode27 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:58723", 8 | "sslPort": 44314 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "WebAPINetCode27": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Hosting; 12 | using Microsoft.Extensions.Logging; 13 | 14 | namespace WebAPINetCode27 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddControllers(); 29 | } 30 | 31 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 32 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 33 | { 34 | if (env.IsDevelopment()) 35 | { 36 | app.UseDeveloperExceptionPage(); 37 | } 38 | 39 | app.UseHttpsRedirection(); 40 | 41 | app.UseRouting(); 42 | 43 | app.UseAuthorization(); 44 | 45 | app.UseEndpoints(endpoints => 46 | { 47 | endpoints.MapControllers(); 48 | }); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/WebAPINetCode27.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | all 12 | runtime; build; native; contentfiles; analyzers; buildtransitive 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_05/WebAPINetCode27/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/DataBase/NetCode27.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_06 - Parte II/DataBase/NetCode27.zip -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.Extensions.Logging; 8 | using MiPrimerAppWeb.Models; 9 | 10 | namespace MiPrimerAppWeb.Controllers 11 | { 12 | public class HomeController : Controller 13 | { 14 | private readonly ILogger _logger; 15 | 16 | public HomeController(ILogger logger) 17 | { 18 | _logger = logger; 19 | } 20 | 21 | public IActionResult Index() 22 | { 23 | return View(); 24 | } 25 | 26 | public IActionResult Privacy() 27 | { 28 | return View(); 29 | } 30 | 31 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 32 | public IActionResult Error() 33 | { 34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/MiPrimerAppWeb.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MiPrimerAppWeb.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Models/PersonaDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace MiPrimerAppWeb.Models 7 | { 8 | public class PersonaDTO 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Models/PersonaViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace MiPrimerAppWeb.Models 7 | { 8 | public class PersonaViewModel 9 | { 10 | public List personas { get; set; } 11 | public PersonaDTO persona { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace MiPrimerAppWeb 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:61792", 7 | "sslPort": 44344 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" 17 | } 18 | }, 19 | "MiPrimerAppWeb": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development", 25 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Hosting; 11 | 12 | namespace MiPrimerAppWeb 13 | { 14 | public class Startup 15 | { 16 | public Startup(IConfiguration configuration) 17 | { 18 | Configuration = configuration; 19 | } 20 | 21 | public IConfiguration Configuration { get; } 22 | 23 | // This method gets called by the runtime. Use this method to add services to the container. 24 | public void ConfigureServices(IServiceCollection services) 25 | { 26 | services.AddControllersWithViews(); 27 | } 28 | 29 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 30 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 31 | { 32 | if (env.IsDevelopment()) 33 | { 34 | app.UseDeveloperExceptionPage(); 35 | } 36 | else 37 | { 38 | app.UseExceptionHandler("/Home/Error"); 39 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 40 | app.UseHsts(); 41 | } 42 | app.UseHttpsRedirection(); 43 | app.UseStaticFiles(); 44 | 45 | app.UseRouting(); 46 | 47 | app.UseAuthorization(); 48 | 49 | app.UseEndpoints(endpoints => 50 | { 51 | endpoints.MapControllerRoute( 52 | name: "default", 53 | pattern: "{controller=Home}/{action=Index}/{id?}"); 54 | }); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

NetCode27

7 | 8 |
9 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/Persona/Actualizar.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaDTO 2 | 3 | @{ 4 | ViewData["Title"] = "Actualizar"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Actualizar

9 | 10 |

PersonaDTO

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 | 51 | 52 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/Persona/Buscar.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaViewModel 2 | @{ 3 | ViewData["Title"] = "Buscar"; 4 | Layout = "~/Views/Shared/_Layout.cshtml"; 5 | } 6 | 7 |

Buscar

8 | 9 |
10 | 11 |
12 | 13 | @using (Html.BeginForm()) 14 | { 15 |
16 | 17 | 18 | Introduzca un ID. 19 |
20 | 21 | 22 | } 23 | 24 |
25 | 26 | @if (Model.persona != null) 27 | { 28 |

Resultado:

29 | 30 |
31 |
32 | 33 | 34 |
35 | 36 |
37 | 38 | 39 |
40 | 41 |
42 | 43 | 44 |
45 | 46 |
47 | 48 | 49 |
50 | 51 |
52 | 53 | 54 |
55 | 56 | 57 | 58 |
59 | } 60 | 61 | 62 | 63 | 64 |
65 | 66 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/Persona/Crear.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaDTO 2 | 3 | @{ 4 | ViewData["Title"] = "Crear"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Crear Persona

9 | 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 | Back to List 49 |
50 | 51 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/Persona/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaViewModel 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Lista de Personas

9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var item in Model.personas) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | } 38 | 39 | 40 |
IdNombreApellido PaternoApellido MaternoEdadEliminarActualizar
@item.Id@item.Nombre@item.ApPaterno@item.ApMaterno@item.Edad@Html.ActionLink("Eliminar", "Eliminar", new { id = item.Id }) @Html.ActionLink("Actualizar", "Actualizar", item)
41 | 42 |
43 | 44 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - MiPrimerAppWeb 7 | 8 | 9 | 10 | 11 |
12 | 42 |
43 |
44 |
45 | @RenderBody() 46 |
47 |
48 | 49 |
50 |
51 | © 2020 - MiPrimerAppWeb - Privacy 52 |
53 |
54 | 55 | 56 | 57 | @RenderSection("Scripts", required: false) 58 | 59 | 60 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MiPrimerAppWeb 2 | @using MiPrimerAppWeb.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/wwwroot/assets/Logo_NetCode27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_06 - Parte II/MiPrimerAppWeb/wwwroot/assets/Logo_NetCode27.png -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/wwwroot/css/site.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 | /* Provide sufficient contrast against white background */ 11 | a { 12 | color: #0366d6; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 22 | color: #fff; 23 | background-color: #1b6ec2; 24 | border-color: #1861ac; 25 | } 26 | 27 | /* Sticky footer styles 28 | -------------------------------------------------- */ 29 | html { 30 | font-size: 14px; 31 | } 32 | @media (min-width: 768px) { 33 | html { 34 | font-size: 16px; 35 | } 36 | } 37 | 38 | .border-top { 39 | border-top: 1px solid #e5e5e5; 40 | } 41 | .border-bottom { 42 | border-bottom: 1px solid #e5e5e5; 43 | } 44 | 45 | .box-shadow { 46 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 47 | } 48 | 49 | button.accept-policy { 50 | font-size: 1rem; 51 | line-height: inherit; 52 | } 53 | 54 | /* Sticky footer styles 55 | -------------------------------------------------- */ 56 | html { 57 | position: relative; 58 | min-height: 100%; 59 | } 60 | 61 | body { 62 | /* Margin bottom by footer height */ 63 | margin-bottom: 60px; 64 | } 65 | .footer { 66 | position: absolute; 67 | bottom: 0; 68 | width: 100%; 69 | white-space: nowrap; 70 | line-height: 60px; /* Vertically center the text there */ 71 | } 72 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_06 - Parte II/MiPrimerAppWeb/wwwroot/favicon.ico -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 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 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAPINetCode27", "WebAPINetCode27\WebAPINetCode27.csproj", "{D304A2C8-54F9-4A69-9C30-51F76278D234}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiPrimerAppWeb", "MiPrimerAppWeb\MiPrimerAppWeb.csproj", "{CD6C347A-07B0-425B-996E-5486B221F02A}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {00F1CCC2-19F3-4BA4-AF91-A2BB8856A06E} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "3.1.5", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/Controllers/WeatherForecastController.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.Extensions.Logging; 7 | 8 | namespace WebAPINetCode27.Controllers 9 | { 10 | [ApiController] 11 | [Route("[controller]")] 12 | public class WeatherForecastController : ControllerBase 13 | { 14 | private static readonly string[] Summaries = new[] 15 | { 16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 17 | }; 18 | 19 | private readonly ILogger _logger; 20 | 21 | public WeatherForecastController(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | [HttpGet] 27 | public IEnumerable Get() 28 | { 29 | var rng = new Random(); 30 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 31 | { 32 | Date = DateTime.Now.AddDays(index), 33 | TemperatureC = rng.Next(-20, 55), 34 | Summary = Summaries[rng.Next(Summaries.Length)] 35 | }) 36 | .ToArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/CorsAuthorizationFilterFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Filters; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | internal class CorsAuthorizationFilterFactory : IFilterMetadata 6 | { 7 | private string v; 8 | 9 | public CorsAuthorizationFilterFactory(string v) 10 | { 11 | this.v = v; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/Model/PersonaDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace WebAPINetCode27.Model 7 | { 8 | public class PersonaDTO 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/ModelDB/NetCode27Context.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata; 4 | 5 | namespace WebAPINetCode27.ModelDB 6 | { 7 | public partial class NetCode27Context : DbContext 8 | { 9 | public NetCode27Context() 10 | { 11 | } 12 | 13 | public NetCode27Context(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | public virtual DbSet Personas { get; set; } 19 | 20 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 21 | { 22 | if (!optionsBuilder.IsConfigured) 23 | { 24 | optionsBuilder.UseSqlServer("Server=.;Database=NetCode27;User Id=sa;Password=Corepro1;"); 25 | 26 | } 27 | } 28 | 29 | protected override void OnModelCreating(ModelBuilder modelBuilder) 30 | { 31 | modelBuilder.Entity(entity => 32 | { 33 | entity.Property(e => e.ApMaterno).IsRequired(); 34 | 35 | entity.Property(e => e.ApPaterno).IsRequired(); 36 | 37 | entity.Property(e => e.Nombre).IsRequired(); 38 | }); 39 | 40 | OnModelCreatingPartial(modelBuilder); 41 | } 42 | 43 | partial void OnModelCreatingPartial(ModelBuilder modelBuilder); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/ModelDB/Personas.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace WebAPINetCode27.ModelDB 5 | { 6 | public partial class Personas 7 | { 8 | public int Id { get; set; } 9 | public string Nombre { get; set; } 10 | public string ApPaterno { get; set; } 11 | public string ApMaterno { get; set; } 12 | public int Edad { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebAPINetCode27 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:58723", 8 | "sslPort": 44314 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "WebAPINetCode27": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Hosting; 12 | using Microsoft.Extensions.Logging; 13 | 14 | namespace WebAPINetCode27 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddControllers(); 29 | 30 | services.AddCors(o => o.AddPolicy("AllowMyOrigin", builder => 31 | { 32 | builder.AllowAnyOrigin() 33 | .AllowAnyMethod() 34 | .AllowAnyHeader(); 35 | })); 36 | 37 | } 38 | 39 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 40 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 41 | { 42 | if (env.IsDevelopment()) 43 | { 44 | app.UseDeveloperExceptionPage(); 45 | } 46 | 47 | app.UseHttpsRedirection(); 48 | 49 | app.UseRouting(); 50 | 51 | app.UseCors("AllowMyOrigin"); 52 | 53 | app.UseAuthorization(); 54 | 55 | app.UseEndpoints(endpoints => 56 | { 57 | endpoints.MapControllers(); 58 | }); 59 | 60 | 61 | 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/WebAPINetCode27.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_06 - Parte II/WebAPINetCode27/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /sesiones/sesion_06/DataBase/NetCode27.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_06/DataBase/NetCode27.zip -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.Extensions.Logging; 8 | using MiPrimerAppWeb.Models; 9 | 10 | namespace MiPrimerAppWeb.Controllers 11 | { 12 | public class HomeController : Controller 13 | { 14 | private readonly ILogger _logger; 15 | 16 | public HomeController(ILogger logger) 17 | { 18 | _logger = logger; 19 | } 20 | 21 | public IActionResult Index() 22 | { 23 | return View(); 24 | } 25 | 26 | public IActionResult Privacy() 27 | { 28 | return View(); 29 | } 30 | 31 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 32 | public IActionResult Error() 33 | { 34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/MiPrimerAppWeb.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MiPrimerAppWeb.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Models/PersonaDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace MiPrimerAppWeb.Models 7 | { 8 | public class PersonaDTO 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Models/PersonaViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace MiPrimerAppWeb.Models 7 | { 8 | public class PersonaViewModel 9 | { 10 | public List personas { get; set; } 11 | public PersonaDTO persona { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace MiPrimerAppWeb 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:61792", 7 | "sslPort": 44344 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" 17 | } 18 | }, 19 | "MiPrimerAppWeb": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development", 25 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Hosting; 11 | 12 | namespace MiPrimerAppWeb 13 | { 14 | public class Startup 15 | { 16 | public Startup(IConfiguration configuration) 17 | { 18 | Configuration = configuration; 19 | } 20 | 21 | public IConfiguration Configuration { get; } 22 | 23 | // This method gets called by the runtime. Use this method to add services to the container. 24 | public void ConfigureServices(IServiceCollection services) 25 | { 26 | services.AddControllersWithViews(); 27 | } 28 | 29 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 30 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 31 | { 32 | if (env.IsDevelopment()) 33 | { 34 | app.UseDeveloperExceptionPage(); 35 | } 36 | else 37 | { 38 | app.UseExceptionHandler("/Home/Error"); 39 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 40 | app.UseHsts(); 41 | } 42 | app.UseHttpsRedirection(); 43 | app.UseStaticFiles(); 44 | 45 | app.UseRouting(); 46 | 47 | app.UseAuthorization(); 48 | 49 | app.UseEndpoints(endpoints => 50 | { 51 | endpoints.MapControllerRoute( 52 | name: "default", 53 | pattern: "{controller=Home}/{action=Index}/{id?}"); 54 | }); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

NetCode27

7 | 8 |
9 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Views/Persona/Buscar.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaViewModel 2 | @{ 3 | ViewData["Title"] = "Buscar"; 4 | Layout = "~/Views/Shared/_Layout.cshtml"; 5 | } 6 | 7 |

Buscar

8 | 9 |
10 | 11 |
12 | 13 | @using (Html.BeginForm()) 14 | { 15 |
16 | 17 | 18 | Introduzca un ID. 19 |
20 | 21 | 22 | } 23 | 24 |
25 | 26 | @if (Model.persona != null) 27 | { 28 |

Resultado:

29 | 30 |
31 |
32 | 33 | 34 |
35 | 36 |
37 | 38 | 39 |
40 | 41 |
42 | 43 | 44 |
45 | 46 |
47 | 48 | 49 |
50 | 51 |
52 | 53 | 54 |
55 | 56 | 57 | 58 |
59 | } 60 | 61 | 62 | 63 | 64 |
65 | 66 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Views/Persona/Crear.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaDTO 2 | 3 | @{ 4 | ViewData["Title"] = "Crear"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Crear Persona

9 | 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 | Back to List 49 |
50 | 51 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Views/Persona/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaViewModel 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Lista de Personas

9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var item in Model.personas) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | } 39 | 40 | 41 |
IdNombreApellido PaternoApellido MaternoEdadEliminarActualizar
@item.Id@item.Nombre@item.ApPaterno@item.ApMaterno@item.Edad
42 | 43 |
44 | 45 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - MiPrimerAppWeb 7 | 8 | 9 | 10 | 11 |
12 | 42 |
43 |
44 |
45 | @RenderBody() 46 |
47 |
48 | 49 |
50 |
51 | © 2020 - MiPrimerAppWeb - Privacy 52 |
53 |
54 | 55 | 56 | 57 | @RenderSection("Scripts", required: false) 58 | 59 | 60 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MiPrimerAppWeb 2 | @using MiPrimerAppWeb.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/wwwroot/assets/Logo_NetCode27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_06/MiPrimerAppWeb/wwwroot/assets/Logo_NetCode27.png -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/wwwroot/css/site.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 | /* Provide sufficient contrast against white background */ 11 | a { 12 | color: #0366d6; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 22 | color: #fff; 23 | background-color: #1b6ec2; 24 | border-color: #1861ac; 25 | } 26 | 27 | /* Sticky footer styles 28 | -------------------------------------------------- */ 29 | html { 30 | font-size: 14px; 31 | } 32 | @media (min-width: 768px) { 33 | html { 34 | font-size: 16px; 35 | } 36 | } 37 | 38 | .border-top { 39 | border-top: 1px solid #e5e5e5; 40 | } 41 | .border-bottom { 42 | border-bottom: 1px solid #e5e5e5; 43 | } 44 | 45 | .box-shadow { 46 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 47 | } 48 | 49 | button.accept-policy { 50 | font-size: 1rem; 51 | line-height: inherit; 52 | } 53 | 54 | /* Sticky footer styles 55 | -------------------------------------------------- */ 56 | html { 57 | position: relative; 58 | min-height: 100%; 59 | } 60 | 61 | body { 62 | /* Margin bottom by footer height */ 63 | margin-bottom: 60px; 64 | } 65 | .footer { 66 | position: absolute; 67 | bottom: 0; 68 | width: 100%; 69 | white-space: nowrap; 70 | line-height: 60px; /* Vertically center the text there */ 71 | } 72 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_06/MiPrimerAppWeb/wwwroot/favicon.ico -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 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 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAPINetCode27", "WebAPINetCode27\WebAPINetCode27.csproj", "{D304A2C8-54F9-4A69-9C30-51F76278D234}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiPrimerAppWeb", "MiPrimerAppWeb\MiPrimerAppWeb.csproj", "{CD6C347A-07B0-425B-996E-5486B221F02A}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {00F1CCC2-19F3-4BA4-AF91-A2BB8856A06E} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "3.1.5", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/Controllers/WeatherForecastController.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.Extensions.Logging; 7 | 8 | namespace WebAPINetCode27.Controllers 9 | { 10 | [ApiController] 11 | [Route("[controller]")] 12 | public class WeatherForecastController : ControllerBase 13 | { 14 | private static readonly string[] Summaries = new[] 15 | { 16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 17 | }; 18 | 19 | private readonly ILogger _logger; 20 | 21 | public WeatherForecastController(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | [HttpGet] 27 | public IEnumerable Get() 28 | { 29 | var rng = new Random(); 30 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 31 | { 32 | Date = DateTime.Now.AddDays(index), 33 | TemperatureC = rng.Next(-20, 55), 34 | Summary = Summaries[rng.Next(Summaries.Length)] 35 | }) 36 | .ToArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/CorsAuthorizationFilterFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Filters; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | internal class CorsAuthorizationFilterFactory : IFilterMetadata 6 | { 7 | private string v; 8 | 9 | public CorsAuthorizationFilterFactory(string v) 10 | { 11 | this.v = v; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/Model/PersonaDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace WebAPINetCode27.Model 7 | { 8 | public class PersonaDTO 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/ModelDB/NetCode27Context.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata; 4 | 5 | namespace WebAPINetCode27.ModelDB 6 | { 7 | public partial class NetCode27Context : DbContext 8 | { 9 | public NetCode27Context() 10 | { 11 | } 12 | 13 | public NetCode27Context(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | public virtual DbSet Personas { get; set; } 19 | 20 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 21 | { 22 | if (!optionsBuilder.IsConfigured) 23 | { 24 | optionsBuilder.UseSqlServer("Server=tcp:netcode27.database.windows.net,1433;Initial Catalog=netcode27;Persist Security Info=False;User ID=usuarionet;Password=Tab2020Net;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"); 25 | } 26 | } 27 | 28 | protected override void OnModelCreating(ModelBuilder modelBuilder) 29 | { 30 | modelBuilder.Entity(entity => 31 | { 32 | entity.Property(e => e.ApMaterno).IsRequired(); 33 | 34 | entity.Property(e => e.ApPaterno).IsRequired(); 35 | 36 | entity.Property(e => e.Nombre).IsRequired(); 37 | }); 38 | 39 | OnModelCreatingPartial(modelBuilder); 40 | } 41 | 42 | partial void OnModelCreatingPartial(ModelBuilder modelBuilder); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/ModelDB/Personas.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace WebAPINetCode27.ModelDB 5 | { 6 | public partial class Personas 7 | { 8 | public int Id { get; set; } 9 | public string Nombre { get; set; } 10 | public string ApPaterno { get; set; } 11 | public string ApMaterno { get; set; } 12 | public int Edad { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebAPINetCode27 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:58723", 8 | "sslPort": 44314 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "WebAPINetCode27": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.AspNetCore.Mvc; 9 | using Microsoft.Extensions.Configuration; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Hosting; 12 | using Microsoft.Extensions.Logging; 13 | 14 | namespace WebAPINetCode27 15 | { 16 | public class Startup 17 | { 18 | public Startup(IConfiguration configuration) 19 | { 20 | Configuration = configuration; 21 | } 22 | 23 | public IConfiguration Configuration { get; } 24 | 25 | // This method gets called by the runtime. Use this method to add services to the container. 26 | public void ConfigureServices(IServiceCollection services) 27 | { 28 | services.AddControllers(); 29 | 30 | services.AddCors(o => o.AddPolicy("AllowMyOrigin", builder => 31 | { 32 | builder.AllowAnyOrigin() 33 | .AllowAnyMethod() 34 | .AllowAnyHeader(); 35 | })); 36 | 37 | } 38 | 39 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 40 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 41 | { 42 | if (env.IsDevelopment()) 43 | { 44 | app.UseDeveloperExceptionPage(); 45 | } 46 | 47 | app.UseHttpsRedirection(); 48 | 49 | app.UseRouting(); 50 | 51 | app.UseCors("AllowMyOrigin"); 52 | 53 | app.UseAuthorization(); 54 | 55 | app.UseEndpoints(endpoints => 56 | { 57 | endpoints.MapControllers(); 58 | }); 59 | 60 | 61 | 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/WebAPINetCode27.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | all 13 | runtime; build; native; contentfiles; analyzers; buildtransitive 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_06/WebAPINetCode27/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/.local/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | {"ProjectWatches":"{\"Value\":[]}","ProjectBreakpoints":"{\"Value\":{\"Main.xaml\":[{\"ConditionalExpression\":null,\"ActionExpression\":null,\"ExpectedHitCounter\":null,\"ShouldContinueAfterAction\":false,\"IsEnabled\":true,\"ActivityIdRef\":\"Delete_1\",\"ActivityId\":\"1.12\",\"ActivityName\":\"Delete\"},{\"ConditionalExpression\":null,\"ActionExpression\":null,\"ExpectedHitCounter\":null,\"ShouldContinueAfterAction\":false,\"IsEnabled\":true,\"ActivityIdRef\":\"AddDataRow_1\",\"ActivityId\":\"1.22\",\"ActivityName\":\"Add Data Row\"}]}}","OpenedDocuments":"[\"Main.xaml\"]"} -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/.local/db/references.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_08/NetCode27Process/.local/db/references.db -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/.local/nuget.cache.backup: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dgSpecHash": "uZe8TumqRuBAMG+j5G9kp4tYgADi3qjzrZSevp443iOaoj+xNLKbHa+RLPl0vsEemEPuHJGo1yObf2lv7kLDiA==", 4 | "success": true 5 | } -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/.objects/.metadata: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "un1eGjy9NkmxwcSg9H0FQw", 3 | "Type": "Library", 4 | "Created": "2020-07-30T00:57:04.5275316Z", 5 | "CreatedBy": [ 6 | "UiPath.Platform, Version=20.4.0.0, Culture=neutral, PublicKeyToken=null" 7 | ], 8 | "Updated": "2020-07-30T00:57:04.5275316Z" 9 | } -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/.objects/.type: -------------------------------------------------------------------------------- 1 | Library -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/.screenshots/7691dab2fb748d742f181a89fa1ace29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_08/NetCode27Process/.screenshots/7691dab2fb748d742f181a89fa1ace29.png -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/.screenshots/bab26a320aa344c86a71b1a74fb56e55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_08/NetCode27Process/.screenshots/bab26a320aa344c86a71b1a74fb56e55.png -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/.screenshots/cdcaca6a4f2bf6b540a89e7a7f90e102.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_08/NetCode27Process/.screenshots/cdcaca6a4f2bf6b540a89e7a7f90e102.png -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/Archivos/consultaCompras.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_08/NetCode27Process/Archivos/consultaCompras.xlsx -------------------------------------------------------------------------------- /sesiones/sesion_08/NetCode27Process/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NetCode27Process", 3 | "description": "Blank Process", 4 | "main": "Main.xaml", 5 | "dependencies": { 6 | "UiPath.Database.Activities": "[1.3.7369.25200]", 7 | "UiPath.Excel.Activities": "[2.9.0-preview]", 8 | "UiPath.Mail.Activities": "[1.9.0-preview]", 9 | "UiPath.PDF.Activities": "[3.2.2]", 10 | "UiPath.System.Activities": "[20.6.1-preview]", 11 | "UiPath.UIAutomation.Activities": "[20.6.0-preview]" 12 | }, 13 | "webServices": [], 14 | "entitiesStores": [], 15 | "schemaVersion": "4.0", 16 | "studioVersion": "20.6.0.0", 17 | "projectVersion": "1.0.0", 18 | "runtimeOptions": { 19 | "autoDispose": false, 20 | "isPausable": true, 21 | "requiresUserInteraction": true, 22 | "supportsPersistence": false, 23 | "excludedLoggedData": [ 24 | "Private:*", 25 | "*password*" 26 | ], 27 | "executionType": "Workflow" 28 | }, 29 | "designOptions": { 30 | "projectProfile": "Developement", 31 | "outputType": "Process", 32 | "libraryOptions": { 33 | "includeOriginalXaml": false, 34 | "privateWorkflows": [] 35 | }, 36 | "fileInfoCollection": [] 37 | }, 38 | "expressionLanguage": "VisualBasic" 39 | } -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/.local/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | {"ProjectBreakpoints":"{\"Value\":{}}","ProjectWatches":"{\"Value\":[]}","LibraryProjectSettings":"{\"IncludeSourcesByDefault\":true,\"UseCompilerV2\":false,\"CompileExpressions\":false,\"DefaultActivitiesRootCategories\":[null]}","OpenedDocuments":"[\"Tests/RunAllTests.xaml\"]"} -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/.local/db/references.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_09/REFNetCode27/.local/db/references.db -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/.local/nuget.cache.backup: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "dgSpecHash": "EBQEXH3F5PnXZEMXK/Gslo0/AVLHz3AXTv5DlEPhUeImgqlqUZ0qlbVqXbpC/zyMBctiKwo5Mrm7XCfSnPnIbA==", 4 | "success": true 5 | } -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/.objects/.metadata: -------------------------------------------------------------------------------- 1 | { 2 | "Id": "hxTlpf1uoUKlP9Z_J6j7lQ", 3 | "Type": "Library", 4 | "Created": "2020-08-06T01:04:23.9896936Z", 5 | "CreatedBy": [ 6 | "UiPath.Platform, Version=20.4.0.0, Culture=neutral, PublicKeyToken=null" 7 | ], 8 | "Updated": "2020-08-06T01:04:23.9896936Z" 9 | } -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/.objects/.type: -------------------------------------------------------------------------------- 1 | Library -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/.screenshots/33dde57b4ed0aa763b9311574b6c13b4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_09/REFNetCode27/.screenshots/33dde57b4ed0aa763b9311574b6c13b4.png -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/.screenshots/3a2c3aad932f78210607d9644739347a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_09/REFNetCode27/.screenshots/3a2c3aad932f78210607d9644739347a.png -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/.screenshots/924f187ca2db1c3388a48272c1c9c985.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_09/REFNetCode27/.screenshots/924f187ca2db1c3388a48272c1c9c985.png -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/Data/Config.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_09/REFNetCode27/Data/Config.xlsx -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/Data/Input/placeholder.txt: -------------------------------------------------------------------------------- 1 | Input folder should be used to store all input files of the process. -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/Data/Output/placeholder.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/Data/ReporteNet.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_09/REFNetCode27/Data/ReporteNet.xlsx -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/Data/Temp/placeholder.txt: -------------------------------------------------------------------------------- 1 | Temp folder should store the files while they are being processed. Once the processing part is done, the files should be removed from this folder. -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/Exceptions_Screenshots/placeholder.txt: -------------------------------------------------------------------------------- 1 | When a System Error is thrown in the process, a screenshot is taken and saved to Exception_Screenshots folder. -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/Tests/TestLog.txt: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/Tests/Tests.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_09/REFNetCode27/Tests/Tests.xlsx -------------------------------------------------------------------------------- /sesiones/sesion_09/REFNetCode27/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "REFNetCode27", 3 | "description": "Robotic Enterprise Framework", 4 | "main": "Main.xaml", 5 | "dependencies": { 6 | "UiPath.Excel.Activities": "[2.9.0-preview]", 7 | "UiPath.System.Activities": "[20.6.1-preview]", 8 | "UiPath.UIAutomation.Activities": "[20.6.0-preview]" 9 | }, 10 | "webServices": [], 11 | "entitiesStores": [], 12 | "schemaVersion": "4.0", 13 | "studioVersion": "20.6.0.0", 14 | "projectVersion": "1.0.1", 15 | "runtimeOptions": { 16 | "autoDispose": false, 17 | "isPausable": true, 18 | "requiresUserInteraction": true, 19 | "supportsPersistence": false, 20 | "excludedLoggedData": [ 21 | "Private:*", 22 | "*password*" 23 | ], 24 | "executionType": "Workflow" 25 | }, 26 | "designOptions": { 27 | "projectProfile": "Developement", 28 | "outputType": "Process", 29 | "libraryOptions": { 30 | "includeOriginalXaml": false, 31 | "privateWorkflows": [] 32 | }, 33 | "fileInfoCollection": [] 34 | }, 35 | "arguments": { 36 | "input": [ 37 | { 38 | "name": "in_OrchestratorQueueName", 39 | "type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", 40 | "required": false, 41 | "hasDefault": false 42 | } 43 | ], 44 | "output": [] 45 | }, 46 | "expressionLanguage": "VisualBasic" 47 | } -------------------------------------------------------------------------------- /sesiones/sesion_10/DataBase/NetCode27.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_10/DataBase/NetCode27.zip -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Controllers/HomeController.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Mvc; 7 | using Microsoft.Extensions.Logging; 8 | using MiPrimerAppWeb.Models; 9 | 10 | namespace MiPrimerAppWeb.Controllers 11 | { 12 | public class HomeController : Controller 13 | { 14 | private readonly ILogger _logger; 15 | 16 | public HomeController(ILogger logger) 17 | { 18 | _logger = logger; 19 | } 20 | 21 | public IActionResult Index() 22 | { 23 | return View(); 24 | } 25 | 26 | public IActionResult Privacy() 27 | { 28 | return View(); 29 | } 30 | 31 | [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] 32 | public IActionResult Error() 33 | { 34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/MiPrimerAppWeb.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | false 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace MiPrimerAppWeb.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Models/PersonaDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace MiPrimerAppWeb.Models 7 | { 8 | public class PersonaDTO 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Models/PersonaViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace MiPrimerAppWeb.Models 7 | { 8 | public class PersonaViewModel 9 | { 10 | public List personas { get; set; } 11 | public PersonaDTO persona { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace MiPrimerAppWeb 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:61792", 7 | "sslPort": 44344 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development", 16 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" 17 | } 18 | }, 19 | "MiPrimerAppWeb": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 23 | "environmentVariables": { 24 | "ASPNETCORE_ENVIRONMENT": "Development", 25 | "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Startup.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Builder; 6 | using Microsoft.AspNetCore.Hosting; 7 | using Microsoft.AspNetCore.HttpsPolicy; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.DependencyInjection; 10 | using Microsoft.Extensions.Hosting; 11 | 12 | namespace MiPrimerAppWeb 13 | { 14 | public class Startup 15 | { 16 | public Startup(IConfiguration configuration) 17 | { 18 | Configuration = configuration; 19 | } 20 | 21 | public IConfiguration Configuration { get; } 22 | 23 | // This method gets called by the runtime. Use this method to add services to the container. 24 | public void ConfigureServices(IServiceCollection services) 25 | { 26 | services.AddControllersWithViews(); 27 | } 28 | 29 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 30 | public void Configure(IApplicationBuilder app, IWebHostEnvironment env) 31 | { 32 | if (env.IsDevelopment()) 33 | { 34 | app.UseDeveloperExceptionPage(); 35 | } 36 | else 37 | { 38 | app.UseExceptionHandler("/Home/Error"); 39 | // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. 40 | app.UseHsts(); 41 | } 42 | app.UseHttpsRedirection(); 43 | app.UseStaticFiles(); 44 | 45 | app.UseRouting(); 46 | 47 | app.UseAuthorization(); 48 | 49 | app.UseEndpoints(endpoints => 50 | { 51 | endpoints.MapControllerRoute( 52 | name: "default", 53 | pattern: "{controller=Home}/{action=Index}/{id?}"); 54 | }); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/Home/Index.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Home Page"; 3 | } 4 | 5 |
6 |

NetCode27

7 | 8 |
9 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/Persona/Actualizar.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaDTO 2 | 3 | @{ 4 | ViewData["Title"] = "Actualizar"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Actualizar

9 | 10 |

PersonaDTO

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 | 51 | 52 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/Persona/Buscar.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaViewModel 2 | @{ 3 | ViewData["Title"] = "Buscar"; 4 | Layout = "~/Views/Shared/_Layout.cshtml"; 5 | } 6 | 7 |

Buscar

8 | 9 |
10 | 11 |
12 | 13 | @using (Html.BeginForm()) 14 | { 15 |
16 | 17 | 18 | Introduzca un ID. 19 |
20 | 21 | 22 | } 23 | 24 |
25 | 26 | @if (Model.persona != null) 27 | { 28 |

Resultado:

29 | 30 |
31 |
32 | 33 | 34 |
35 | 36 |
37 | 38 | 39 |
40 | 41 |
42 | 43 | 44 |
45 | 46 |
47 | 48 | 49 |
50 | 51 |
52 | 53 | 54 |
55 | 56 | 57 | 58 |
59 | } 60 | 61 | 62 | 63 | 64 |
65 | 66 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/Persona/Crear.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaDTO 2 | 3 | @{ 4 | ViewData["Title"] = "Crear"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Crear Persona

9 | 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 | Back to List 49 |
50 | 51 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/Persona/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model MiPrimerAppWeb.Models.PersonaViewModel 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | Layout = "~/Views/Shared/_Layout.cshtml"; 6 | } 7 | 8 |

Lista de Personas

9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | @foreach (var item in Model.personas) 27 | { 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | } 38 | 39 | 40 |
IdNombreApellido PaternoApellido MaternoEdadEliminarActualizar
@item.Id@item.Nombre@item.ApPaterno@item.ApMaterno@item.Edad@Html.ActionLink("Eliminar", "Eliminar", new { id = item.Id }) @Html.ActionLink("Actualizar", "Actualizar", item)
41 | 42 |
43 | 44 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/Shared/_Layout.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | @ViewData["Title"] - MiPrimerAppWeb 7 | 8 | 9 | 10 | 11 |
12 | 42 |
43 |
44 |
45 | @RenderBody() 46 |
47 |
48 | 49 |
50 |
51 | © 2020 - MiPrimerAppWeb - Privacy 52 |
53 |
54 | 55 | 56 | 57 | @RenderSection("Scripts", required: false) 58 | 59 | 60 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using MiPrimerAppWeb 2 | @using MiPrimerAppWeb.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/wwwroot/assets/Logo_NetCode27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_10/MiPrimerAppWeb/wwwroot/assets/Logo_NetCode27.png -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/wwwroot/css/site.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 | /* Provide sufficient contrast against white background */ 11 | a { 12 | color: #0366d6; 13 | } 14 | 15 | .btn-primary { 16 | color: #fff; 17 | background-color: #1b6ec2; 18 | border-color: #1861ac; 19 | } 20 | 21 | .nav-pills .nav-link.active, .nav-pills .show > .nav-link { 22 | color: #fff; 23 | background-color: #1b6ec2; 24 | border-color: #1861ac; 25 | } 26 | 27 | /* Sticky footer styles 28 | -------------------------------------------------- */ 29 | html { 30 | font-size: 14px; 31 | } 32 | @media (min-width: 768px) { 33 | html { 34 | font-size: 16px; 35 | } 36 | } 37 | 38 | .border-top { 39 | border-top: 1px solid #e5e5e5; 40 | } 41 | .border-bottom { 42 | border-bottom: 1px solid #e5e5e5; 43 | } 44 | 45 | .box-shadow { 46 | box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .05); 47 | } 48 | 49 | button.accept-policy { 50 | font-size: 1rem; 51 | line-height: inherit; 52 | } 53 | 54 | /* Sticky footer styles 55 | -------------------------------------------------- */ 56 | html { 57 | position: relative; 58 | min-height: 100%; 59 | } 60 | 61 | body { 62 | /* Margin bottom by footer height */ 63 | margin-bottom: 60px; 64 | } 65 | .footer { 66 | position: absolute; 67 | bottom: 0; 68 | width: 100%; 69 | white-space: nowrap; 70 | line-height: 60px; /* Vertically center the text there */ 71 | } 72 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_10/MiPrimerAppWeb/wwwroot/favicon.ico -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2018 Twitter, Inc. 4 | Copyright (c) 2011-2018 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 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_10/MiPrimerAppWeb/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 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30104.148 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebAPINetCode27", "WebAPINetCode27\WebAPINetCode27.csproj", "{D304A2C8-54F9-4A69-9C30-51F76278D234}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiPrimerAppWeb", "MiPrimerAppWeb\MiPrimerAppWeb.csproj", "{CD6C347A-07B0-425B-996E-5486B221F02A}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {D304A2C8-54F9-4A69-9C30-51F76278D234}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {CD6C347A-07B0-425B-996E-5486B221F02A}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {00F1CCC2-19F3-4BA4-AF91-A2BB8856A06E} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "3.1.5", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/Controllers/WeatherForecastController.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.Extensions.Logging; 7 | 8 | namespace WebAPINetCode27.Controllers 9 | { 10 | [ApiController] 11 | [Route("[controller]")] 12 | public class WeatherForecastController : ControllerBase 13 | { 14 | private static readonly string[] Summaries = new[] 15 | { 16 | "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" 17 | }; 18 | 19 | private readonly ILogger _logger; 20 | 21 | public WeatherForecastController(ILogger logger) 22 | { 23 | _logger = logger; 24 | } 25 | 26 | [HttpGet] 27 | public IEnumerable Get() 28 | { 29 | var rng = new Random(); 30 | return Enumerable.Range(1, 5).Select(index => new WeatherForecast 31 | { 32 | Date = DateTime.Now.AddDays(index), 33 | TemperatureC = rng.Next(-20, 55), 34 | Summary = Summaries[rng.Next(Summaries.Length)] 35 | }) 36 | .ToArray(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/CorsAuthorizationFilterFactory.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.Filters; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | internal class CorsAuthorizationFilterFactory : IFilterMetadata 6 | { 7 | private string v; 8 | 9 | public CorsAuthorizationFilterFactory(string v) 10 | { 11 | this.v = v; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/Model/LoginDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace WebAPINetCode27.Model 7 | { 8 | public class LoginDTO 9 | { 10 | public string Usuario { get; set; } 11 | public string Password { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/Model/PersonaDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace WebAPINetCode27.Model 7 | { 8 | public class PersonaDTO 9 | { 10 | public int Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string ApPaterno { get; set; } 13 | public string ApMaterno { get; set; } 14 | public int Edad { get; set; } 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/Model/UsuarioDTO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace WebAPINetCode27.Model 7 | { 8 | public class UsuarioDTO 9 | { 10 | public Guid Id { get; set; } 11 | public string Nombre { get; set; } 12 | public string Apellidos { get; set; } 13 | public string Email { get; set; } 14 | public string Rol { get; set; } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/ModelDB/NetCode27Context.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.EntityFrameworkCore; 3 | using Microsoft.EntityFrameworkCore.Metadata; 4 | 5 | namespace WebAPINetCode27.ModelDB 6 | { 7 | public partial class NetCode27Context : DbContext 8 | { 9 | public NetCode27Context() 10 | { 11 | } 12 | 13 | public NetCode27Context(DbContextOptions options) 14 | : base(options) 15 | { 16 | } 17 | 18 | public virtual DbSet Personas { get; set; } 19 | 20 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 21 | { 22 | if (!optionsBuilder.IsConfigured) 23 | { 24 | optionsBuilder.UseSqlServer("Server=tcp:netcode27.database.windows.net,1433;Initial Catalog=netcode27;Persist Security Info=False;User ID=netcode;Password=Villahermosa2020;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;"); 25 | 26 | } 27 | } 28 | 29 | protected override void OnModelCreating(ModelBuilder modelBuilder) 30 | { 31 | modelBuilder.Entity(entity => 32 | { 33 | entity.Property(e => e.ApMaterno).IsRequired(); 34 | 35 | entity.Property(e => e.ApPaterno).IsRequired(); 36 | 37 | entity.Property(e => e.Nombre).IsRequired(); 38 | }); 39 | 40 | OnModelCreatingPartial(modelBuilder); 41 | } 42 | 43 | partial void OnModelCreatingPartial(ModelBuilder modelBuilder); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/ModelDB/Personas.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace WebAPINetCode27.ModelDB 5 | { 6 | public partial class Personas 7 | { 8 | public int Id { get; set; } 9 | public string Nombre { get; set; } 10 | public string ApPaterno { get; set; } 11 | public string ApMaterno { get; set; } 12 | public int Edad { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Microsoft.AspNetCore.Hosting; 6 | using Microsoft.Extensions.Configuration; 7 | using Microsoft.Extensions.Hosting; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace WebAPINetCode27 11 | { 12 | public class Program 13 | { 14 | public static void Main(string[] args) 15 | { 16 | CreateHostBuilder(args).Build().Run(); 17 | } 18 | 19 | public static IHostBuilder CreateHostBuilder(string[] args) => 20 | Host.CreateDefaultBuilder(args) 21 | .ConfigureWebHostDefaults(webBuilder => 22 | { 23 | webBuilder.UseStartup(); 24 | }); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:58723", 8 | "sslPort": 44314 9 | } 10 | }, 11 | "profiles": { 12 | "IIS Express": { 13 | "commandName": "IISExpress", 14 | "launchBrowser": true, 15 | "launchUrl": "weatherforecast", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | } 19 | }, 20 | "WebAPINetCode27": { 21 | "commandName": "Project", 22 | "launchBrowser": true, 23 | "launchUrl": "weatherforecast", 24 | "applicationUrl": "https://localhost:5001;http://localhost:5000", 25 | "environmentVariables": { 26 | "ASPNETCORE_ENVIRONMENT": "Development" 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/Startup.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/noriammx/netcode27/4d6283fb6c6f424503d7f71f7647578cd6a3866d/sesiones/sesion_10/WebAPINetCode27/Startup.cs -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/WeatherForecast.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebAPINetCode27 4 | { 5 | public class WeatherForecast 6 | { 7 | public DateTime Date { get; set; } 8 | 9 | public int TemperatureC { get; set; } 10 | 11 | public int TemperatureF => 32 + (int)(TemperatureC / 0.5556); 12 | 13 | public string Summary { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/WebAPINetCode27.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp3.1 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | all 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /sesiones/sesion_10/WebAPINetCode27/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "JWT": { 3 | "secret": "\"NetCode27y3y3\"#$\"#$\"", 4 | "Issuer": "www.netcode27.com", 5 | "Audience": "www.netcode27.com/api/" 6 | }, 7 | 8 | 9 | "Logging": { 10 | "LogLevel": { 11 | "Default": "Information", 12 | "Microsoft": "Warning", 13 | "Microsoft.Hosting.Lifetime": "Information" 14 | } 15 | }, 16 | "AllowedHosts": "*" 17 | } 18 | --------------------------------------------------------------------------------