├── .vscode ├── settings.json └── tasks.json ├── CH06 ├── XSS │ ├── Pages │ │ ├── _ViewStart.cshtml │ │ ├── User.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Privacy.cshtml │ │ ├── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Privacy.cshtml.cs │ │ ├── Login.cshtml │ │ ├── Index.cshtml.cs │ │ ├── Index.cshtml │ │ ├── Error.cshtml.cs │ │ ├── Error.cshtml │ │ └── User.cshtml.cs │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── js │ │ │ └── site.js │ │ ├── csrf.html │ │ ├── lib │ │ │ ├── jquery-validation-unobtrusive │ │ │ │ └── LICENSE.txt │ │ │ ├── jquery-validation │ │ │ │ └── LICENSE.md │ │ │ ├── bootstrap │ │ │ │ └── LICENSE │ │ │ └── jquery │ │ │ │ └── LICENSE.txt │ │ └── css │ │ │ └── site.css │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── FoobleXSS.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── Startup.cs └── LoginExample │ ├── UserContext.cs │ ├── UserEntity.cs │ ├── LoginExample.csproj │ ├── UserEF.cs │ └── User.cs ├── .eslintrc ├── CH03 ├── Shoppidy │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Home │ │ │ ├── Privacy.cshtml │ │ │ └── Index.cshtml │ │ └── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── js │ │ │ └── site.js │ │ ├── lib │ │ │ ├── jquery-validation-unobtrusive │ │ │ │ └── LICENSE.txt │ │ │ ├── jquery-validation │ │ │ │ └── LICENSE.md │ │ │ ├── bootstrap │ │ │ │ └── LICENSE │ │ │ └── jquery │ │ │ │ └── LICENSE.txt │ │ └── css │ │ │ └── site.css │ ├── Shoppidy.csproj │ ├── Models │ │ ├── IShipmentService.cs │ │ ├── ErrorViewModel.cs │ │ └── ShipmentAddress.cs │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Properties │ │ └── launchSettings.json │ ├── Program.cs │ ├── Controllers │ │ └── HomeController.cs │ └── Startup.cs ├── Twistat │ ├── Pages │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Login.cshtml │ │ ├── Callback.cshtml │ │ ├── Privacy.cshtml │ │ ├── Shared │ │ │ ├── _ValidationScriptsPartial.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Index.cshtml │ │ ├── Index.cshtml.cs │ │ ├── Privacy.cshtml.cs │ │ ├── Error.cshtml.cs │ │ ├── Callback.cshtml.cs │ │ ├── Login.cshtml.cs │ │ └── Error.cshtml │ ├── wwwroot │ │ ├── favicon.ico │ │ ├── js │ │ │ └── site.js │ │ ├── lib │ │ │ ├── jquery-validation-unobtrusive │ │ │ │ └── LICENSE.txt │ │ │ ├── jquery-validation │ │ │ │ └── LICENSE.md │ │ │ ├── bootstrap │ │ │ │ └── LICENSE │ │ │ └── jquery │ │ │ │ └── LICENSE.txt │ │ └── css │ │ │ └── site.css │ ├── Properties │ │ ├── serviceDependencies.json │ │ ├── serviceDependencies.local.json │ │ └── launchSettings.json │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Program.cs │ ├── Twistat.csproj │ ├── Twitter.cs │ └── Startup.cs ├── HttpHandler │ ├── Handler.cs │ ├── Properties │ │ └── launchSettings.json │ ├── TempReader.csproj │ ├── HttpStatusCodeClass.cs │ └── Program.cs ├── TechnicalDebt │ ├── Class1.cs │ └── TechnicalDebt.csproj ├── IfElse │ ├── IfElse.csproj │ └── IDatabase.cs ├── OrderAPI │ ├── OrderAPI.csproj │ ├── PostalAddress.cs │ └── Shipping.cs ├── ClassesVsStructs │ ├── ClassesVsStructs.csproj │ └── Identifier.cs └── EmojiChat │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── EmojiChat.csproj │ ├── WeatherForecast.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Controllers │ ├── WeatherForecastController.cs │ └── StatsController.cs │ └── Startup.cs ├── CH05 ├── BlabberCore │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── _ViewImports.cshtml │ │ ├── Shared │ │ │ ├── EditorTemplates │ │ │ │ └── BlabForm.cshtml │ │ │ ├── DisplayTemplates │ │ │ │ └── Blab.cshtml │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ └── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ └── Index.cshtml │ ├── blabber.db │ ├── wwwroot │ │ ├── favicon.ico │ │ └── Content │ │ │ └── Site.css │ ├── .eslintignore │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── Program.cs │ ├── DB │ │ ├── BlabEntity.cs │ │ ├── BlabDb.cs │ │ └── BlabberContext.cs │ ├── Controllers │ │ ├── BlabController.cs │ │ └── HomeController.cs │ ├── Properties │ │ └── launchSettings.json │ ├── Migrations │ │ ├── 20201117054127_Initial.cs │ │ ├── BlabberContextModelSnapshot.cs │ │ └── 20201117054127_Initial.Designer.cs │ ├── BlabberCore.csproj │ └── Startup.cs ├── Blabber │ ├── Views │ │ ├── _ViewStart.cshtml │ │ ├── Shared │ │ │ ├── EditorTemplates │ │ │ │ └── BlabForm.cshtml │ │ │ ├── DisplayTemplates │ │ │ │ └── Blab.cshtml │ │ │ ├── Error.cshtml │ │ │ └── _Layout.cshtml │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ └── Index.cshtml │ │ └── Web.config │ ├── favicon.ico │ ├── App_Data │ │ └── blabber.db │ ├── Global.asax │ ├── DB │ │ ├── BlabberContext.cs │ │ ├── BlabEntity.cs │ │ └── BlabDb.cs │ ├── App_Start │ │ ├── RouteConfig.cs │ │ └── BundleConfig.cs │ ├── DefaultDependencyResolver.cs │ ├── Controllers │ │ ├── BlabController.cs │ │ └── HomeController.cs │ ├── Content │ │ └── Site.css │ ├── Web.Debug.config │ ├── Web.Release.config │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Global.asax.cs │ └── packages.config ├── DI │ ├── DI.csproj │ └── Program.cs └── Blabber.Models │ ├── HomepageModel.cs │ ├── BlabForm.cs │ ├── Blabber.Models.csproj │ ├── DateTimeExtensions.cs │ ├── Blab.cs │ └── BlabStorage.cs ├── CH02 ├── Nullability │ ├── MoveResult.cs │ ├── Nullability.csproj │ ├── DbId.cs │ ├── Person.cs │ └── TopicService.cs ├── ValidationContext │ ├── MoveResult.cs │ ├── ValidationContext.csproj │ ├── Arrow.cs │ ├── Username.cs │ ├── ParameterTypes.cs │ ├── PostId.cs │ └── DbId.cs ├── Strings │ ├── Strings.csproj │ ├── Concat.cs │ ├── Locales.cs │ └── StringExample.cs ├── Algorithms │ ├── Algorithms.csproj │ ├── Dictionary.cs │ ├── Structs.cs │ └── ContainsAlgorithms.cs ├── Arrays │ ├── Arrays.csproj │ ├── Program.cs │ └── Arrays.cs ├── ReferenceVsValueTypes │ ├── ReferenceVsValueTypes.csproj │ └── Program.cs ├── HashCode │ ├── HashcodeCombine.cs │ ├── HashCodeTest.cs │ ├── ProperGetHashCode.cs │ ├── HashCode.csproj │ ├── Properties │ │ └── AssemblyInfo.cs │ └── HashCode.csproj.old └── Supercalifragilisticexpialidocious │ ├── Supercalifragilisticexpialidocious.csproj │ └── Program.cs ├── CH04 ├── Summer │ ├── SumHelper.cs │ └── Summer.csproj ├── DateUtils │ ├── DateUtils.csproj │ └── DateTimeExtensions.cs ├── Posts │ ├── Posts.csproj │ ├── IPostRepository.cs │ └── PostService.cs ├── User │ ├── User.csproj │ └── Username.cs └── DateUtilsTests │ ├── Tests.csproj │ ├── Program.cs │ ├── UsernameTest.cs │ └── FrameworkTests.cs ├── CH07 ├── Patterns │ ├── IDb.cs │ ├── Boolean.cs │ ├── Patterns.csproj │ ├── Badge.cs │ ├── BufferProcessorBenchmark.cs │ ├── StringController.cs │ ├── Program.cs │ ├── User.cs │ ├── ChecksumBenchmark.cs │ ├── UserPreferences.cs │ ├── BranchPrediction.cs │ ├── Checksum.cs │ ├── MemberAccessBenchmark.cs │ ├── BufferProcessor.cs │ └── Luhn.cs ├── IO │ ├── IO.csproj │ ├── Program.cs │ └── FileCopyBenchmark.cs └── BenchmarkRunner │ ├── SimpleBenchmarkRunner.csproj │ ├── SampleBenchmarkSuite.cs │ └── Program.cs ├── CH09 ├── InfiniteLoop │ ├── InfiniteLoop.csproj │ └── Program.cs └── Exceptions │ ├── Exceptions.csproj │ ├── IDatabase.cs │ ├── Int.cs │ ├── ImageAlbum.cs │ ├── Voting.cs │ ├── OrderController.cs │ └── Program.cs ├── CH08 └── Connections │ ├── Circle.cs │ ├── Properties │ └── launchSettings.json │ ├── Connections.csproj │ ├── UniqueIdGenerator.cs │ ├── AsyncCounter.cs │ ├── Program.cs │ ├── ApiTokensLockFree.cs │ ├── ParallelWeb.cs │ ├── CpuBound.cs │ ├── LimitedList.cs │ ├── ApiTokens.cs │ ├── Cache.cs │ └── Post.cs ├── streetcoder-nowin.slnf └── README.md /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "dotnet.preferCSharpExtension": true 3 | } -------------------------------------------------------------------------------- /CH06/XSS/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "ignorePatterns": "**/*" 4 | } 5 | -------------------------------------------------------------------------------- /CH03/Shoppidy/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /CH03/Twistat/Pages/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /CH05/BlabberCore/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /CH03/HttpHandler/Handler.cs: -------------------------------------------------------------------------------- 1 | namespace HttpHandler; 2 | 3 | public class Handler 4 | { 5 | } -------------------------------------------------------------------------------- /CH05/Blabber/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "~/Views/Shared/_Layout.cshtml"; 3 | } -------------------------------------------------------------------------------- /CH05/Blabber/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssg/streetcoder/HEAD/CH05/Blabber/favicon.ico -------------------------------------------------------------------------------- /CH06/XSS/Pages/User.cshtml: -------------------------------------------------------------------------------- 1 | @page "{username}" 2 | @model FoobleXSS.Pages.UserModel 3 | @{ 4 | } 5 | -------------------------------------------------------------------------------- /CH05/BlabberCore/blabber.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssg/streetcoder/HEAD/CH05/BlabberCore/blabber.db -------------------------------------------------------------------------------- /CH06/XSS/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssg/streetcoder/HEAD/CH06/XSS/wwwroot/favicon.ico -------------------------------------------------------------------------------- /CH03/Shoppidy/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssg/streetcoder/HEAD/CH03/Shoppidy/wwwroot/favicon.ico -------------------------------------------------------------------------------- /CH03/Twistat/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssg/streetcoder/HEAD/CH03/Twistat/wwwroot/favicon.ico -------------------------------------------------------------------------------- /CH05/Blabber/App_Data/blabber.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssg/streetcoder/HEAD/CH05/Blabber/App_Data/blabber.db -------------------------------------------------------------------------------- /CH05/Blabber/Global.asax: -------------------------------------------------------------------------------- 1 | <%@ Application Codebehind="Global.asax.cs" Inherits="Blabber.MvcApplication" Language="C#" %> 2 | -------------------------------------------------------------------------------- /CH05/BlabberCore/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ssg/streetcoder/HEAD/CH05/BlabberCore/wwwroot/favicon.ico -------------------------------------------------------------------------------- /CH06/XSS/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @namespace FoobleXSS.Pages 2 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 3 | -------------------------------------------------------------------------------- /CH02/Nullability/MoveResult.cs: -------------------------------------------------------------------------------- 1 | public enum MoveResult 2 | { 3 | Success, 4 | Unauthorized, 5 | AlreadyMoved 6 | } -------------------------------------------------------------------------------- /CH02/ValidationContext/MoveResult.cs: -------------------------------------------------------------------------------- 1 | public enum MoveResult 2 | { 3 | Success, 4 | Unauthorized, 5 | AlreadyMoved 6 | } -------------------------------------------------------------------------------- /CH05/BlabberCore/.eslintignore: -------------------------------------------------------------------------------- 1 | # first line is for UTF-8 BOM safety 2 | # https://github.com/eslint/eslint/issues/11777 3 | 4 | Scripts/ -------------------------------------------------------------------------------- /CH03/Shoppidy/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Shoppidy 2 | @using Shoppidy.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /CH03/Twistat/Pages/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Twistat 2 | @namespace Twistat.Pages 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /CH05/Blabber/Views/Shared/EditorTemplates/BlabForm.cshtml: -------------------------------------------------------------------------------- 1 | @model BlabForm 2 | @Html.TextAreaFor(m => m.Content, 3, 5, new { @class = "blabeditor" }) -------------------------------------------------------------------------------- /CH05/BlabberCore/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using Blabber 2 | @using Blabber.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /CH03/Twistat/Pages/Login.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model Twistat.Pages.LoginModel 3 | @{ 4 | ViewData["Title"] = "Login"; 5 | } 6 | 7 |
Use this page to detail your site's privacy policy.
7 | -------------------------------------------------------------------------------- /CH03/TechnicalDebt/TechnicalDebt.csproj: -------------------------------------------------------------------------------- 1 |Use this page to detail your site's privacy policy.
9 | -------------------------------------------------------------------------------- /CH03/Shoppidy/Models/IShipmentService.cs: -------------------------------------------------------------------------------- 1 | internal interface IShipmentService 2 | { 3 | ShippingFormValidationResult ValidateShippingForm(ShipmentAddress form); 4 | bool SaveShippingInfo(ShipmentAddress form); 5 | } 6 | -------------------------------------------------------------------------------- /CH03/Twistat/Pages/Privacy.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model PrivacyModel 3 | @{ 4 | ViewData["Title"] = "Privacy Policy"; 5 | } 6 |Use this page to detail your site's privacy policy.
9 | -------------------------------------------------------------------------------- /CH02/Arrays/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Arrays; 4 | 5 | internal static class Program 6 | { 7 | public static void Main() 8 | { 9 | Console.WriteLine(Arrays.ArrayVsList()); 10 | } 11 | } -------------------------------------------------------------------------------- /CH06/XSS/Pages/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /CH07/Patterns/IDb.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Patterns; 4 | internal interface IDb 5 | { 6 | public IEnumerableBlabber is an anonymous social media that keeps 8 | content only for the last 24 hours.
-------------------------------------------------------------------------------- /CH02/ReferenceVsValueTypes/ReferenceVsValueTypes.csproj: -------------------------------------------------------------------------------- 1 |Blabber is an anonymous social media that keeps 8 | content only for the last 24 hours.
9 | -------------------------------------------------------------------------------- /CH06/XSS/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /CH03/EmojiChat/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /CH03/Shoppidy/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /CH03/Twistat/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /CH03/Twistat/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. -------------------------------------------------------------------------------- /CH05/BlabberCore/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft": "Warning", 6 | "Microsoft.Hosting.Lifetime": "Information" 7 | } 8 | }, 9 | "AllowedHosts": "*" 10 | } 11 | -------------------------------------------------------------------------------- /CH06/XSS/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 | -------------------------------------------------------------------------------- /CH03/Shoppidy/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 | -------------------------------------------------------------------------------- /CH05/Blabber.Models/HomepageModel.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace Blabber 4 | { 5 | public class HomepageModel 6 | { 7 | public BlabForm Form { get; set; } 8 | 9 | public IEnumerableLearn about building Web apps with ASP.NET Core.
8 |8 | Blabber is an example from the book Street Coder 9 | from Manning Publications. 10 |
-------------------------------------------------------------------------------- /CH05/BlabberCore/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewBag.Title = "Contact"; 3 | } 4 |8 | Blabber is an example from the book Street Coder 9 | from Manning Publications. 10 |
11 | -------------------------------------------------------------------------------- /CH03/Twistat/Pages/Index.cshtml: -------------------------------------------------------------------------------- 1 | @page 2 | @model IndexModel 3 | @{ 4 | ViewData["Title"] = "Home page"; 5 | } 6 | 7 |Learn about building Web apps with ASP.NET Core.
10 |Please click on the button to continue
8 | 12 | -------------------------------------------------------------------------------- /CH03/Twistat/Pages/Privacy.cshtml.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc.RazorPages; 2 | using Microsoft.Extensions.Logging; 3 | 4 | namespace Twistat.Pages; 5 | 6 | public class PrivacyModel : PageModel 7 | { 8 | private readonly ILoggerNo blabs yet!
20 | } 21 | else 22 | { 23 | @Html.DisplayFor(m => m.Blabs) 24 | } 25 |No blabs yet!
20 | } 21 | else 22 | { 23 | @Html.DisplayFor(m => m.Blabs) 24 | } 25 |10 | Fooble is the ultimate useless search engine that returns nothing. 11 |
12 | @if (Model.Query is object) { 13 |14 | Your search for "@Model.Query" 15 | didn't return any results. 16 |
17 | } 18 | 23 |