Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Jill Balzano authored and Jill Balzano committed Dec 30, 2019
0 parents commit 2479b49
Show file tree
Hide file tree
Showing 480 changed files with 152,681 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
Binary file added 9781484255087.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions Chapter_01/HelloWorldMVC/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using HelloWorldMVC.Models;


namespace HelloWorldMVC.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
AppMessage obj = new AppMessage() {
Message = "Hello World!"
};
return View(obj);
}

[HttpPost]
public IActionResult Index(AppMessage obj)
{
ViewBag.Message = "Message changed.";
return View(obj);
}

}
}
11 changes: 11 additions & 0 deletions Chapter_01/HelloWorldMVC/HelloWorldMVC.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="3.0.0" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions Chapter_01/HelloWorldMVC/HelloWorldMVC.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28822.285
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorldMVC", "HelloWorldMVC.csproj", "{8334EA31-D21D-4B37-BD6D-5F519AB01E9A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8334EA31-D21D-4B37-BD6D-5F519AB01E9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8334EA31-D21D-4B37-BD6D-5F519AB01E9A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8334EA31-D21D-4B37-BD6D-5F519AB01E9A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8334EA31-D21D-4B37-BD6D-5F519AB01E9A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {C7786191-7DD4-4B6C-AFFA-2CADFDB12071}
EndGlobalSection
EndGlobal
12 changes: 12 additions & 0 deletions Chapter_01/HelloWorldMVC/Models/AppMessage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace HelloWorldMVC.Models
{
public class AppMessage
{
public string Message { get; set; }
}
}
26 changes: 26 additions & 0 deletions Chapter_01/HelloWorldMVC/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace HelloWorldMVC
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
27 changes: 27 additions & 0 deletions Chapter_01/HelloWorldMVC/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:49328",
"sslPort": 44338
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"HelloWorldMVC": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5000"
}
}
}
45 changes: 45 additions & 0 deletions Chapter_01/HelloWorldMVC/Startup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;


namespace HelloWorldMVC
{
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}

app.UseStaticFiles();

app.UseRouting();

app.UseEndpoints(endpoints =>
{
endpoints.MapControllerRoute(
name: "default",
pattern: "{controller=Home}/{action=Index}/{id?}");
});





}
}
}
19 changes: 19 additions & 0 deletions Chapter_01/HelloWorldMVC/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@model HelloWorldMVC.Models.AppMessage

<html>
<head>
<title>Hello World App</title>
</head>
<body>
<h1>@Model.Message</h1>
<hr />
<h2>@ViewBag.Message</h2>
<form asp-controller="Home" asp-action="Index" method="post">
<label asp-for="Message">Enter Message :</label>
<br /><br />
<input type="text" asp-for="Message" />
<br /><br />
<button type="submit">Submit</button>
</form>
</body>
</html>
1 change: 1 addition & 0 deletions Chapter_01/HelloWorldMVC/Views/_ViewImports.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@addTagHelper *,Microsoft.AspNetCore.Mvc.TagHelpers
9 changes: 9 additions & 0 deletions Chapter_01/HelloWorldMVC/appsettings.Development.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Information"
}
}
}
9 changes: 9 additions & 0 deletions Chapter_01/HelloWorldMVC/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"Logging": {
"LogLevel": {
"Default": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*"
}
7 changes: 7 additions & 0 deletions Chapter_01/HelloWorldRazorPages/HelloWorldRazorPages.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>

</Project>
25 changes: 25 additions & 0 deletions Chapter_01/HelloWorldRazorPages/HelloWorldRazorPages.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.28822.285
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorldRazorPages", "HelloWorldRazorPages.csproj", "{FC77A0F8-C1E3-410E-B18F-E86369845D08}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{FC77A0F8-C1E3-410E-B18F-E86369845D08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC77A0F8-C1E3-410E-B18F-E86369845D08}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC77A0F8-C1E3-410E-B18F-E86369845D08}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FC77A0F8-C1E3-410E-B18F-E86369845D08}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EE279264-469E-46A1-AD8B-74E665B5962B}
EndGlobalSection
EndGlobal
12 changes: 12 additions & 0 deletions Chapter_01/HelloWorldRazorPages/Models/AppMessage.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace HelloWorldRazorPages.Models
{
public class AppMessage
{
public string Message { get; set; }
}
}
21 changes: 21 additions & 0 deletions Chapter_01/HelloWorldRazorPages/Pages/Index.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@page

@model HelloWorldRazorPages.Pages.IndexModel

<html>
<head>
<title>Hello World App</title>
</head>
<body>
<h1>@Model.Heading.Message</h1>
<hr />
<h2>@Model.SubHeading</h2>
<form method="post">
<label asp-for="Heading.Message">Enter Message :</label>
<br /><br />
<input type="text" asp-for="Heading.Message" />
<br /><br />
<button type="submit">Submit</button>
</form>
</body>
</html>
31 changes: 31 additions & 0 deletions Chapter_01/HelloWorldRazorPages/Pages/Index.cshtml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using HelloWorldRazorPages.Models;


namespace HelloWorldRazorPages.Pages
{
public class IndexModel : PageModel
{
[BindProperty]
public AppMessage Heading { get; set; }

public string SubHeading { get; set; }

public void OnGet()
{
this.Heading = new AppMessage();
this.Heading.Message = "Hello World!";
}

public void OnPost()
{
this.SubHeading = "Message changed.";
}

}
}
1 change: 1 addition & 0 deletions Chapter_01/HelloWorldRazorPages/Pages/_ViewImports.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@addTagHelper *,Microsoft.AspNetCore.Mvc.TagHelpers
26 changes: 26 additions & 0 deletions Chapter_01/HelloWorldRazorPages/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;

namespace HelloWorldRazorPages
{
public class Program
{
public static void Main(string[] args)
{
CreateHostBuilder(args).Build().Run();
}

public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
webBuilder.UseStartup<Startup>();
});
}
}
27 changes: 27 additions & 0 deletions Chapter_01/HelloWorldRazorPages/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:49291",
"sslPort": 44308
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"HelloWorldRazorPages": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5000"
}
}
}
Loading

0 comments on commit 2479b49

Please sign in to comment.