├── .gitattributes ├── .gitignore ├── M2Downloads (Creating a ...) └── After │ ├── SamuraiApp │ ├── SamuraiApp.Data │ │ ├── Migrations │ │ │ ├── 20171117193749_initial.Designer.cs │ │ │ ├── 20171117193749_initial.cs │ │ │ ├── 20171125220938_relationships.Designer.cs │ │ │ ├── 20171125220938_relationships.cs │ │ │ └── SamuraiContextModelSnapshot.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SamuraiApp.Data.csproj │ │ ├── SamuraiContext.cs │ │ ├── app.config │ │ └── packages.config │ ├── SamuraiApp.Domain │ │ ├── Battle.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Quote.cs │ │ ├── Samurai.cs │ │ ├── SamuraiApp.Domain.csproj │ │ ├── SamuraiBattle.cs │ │ └── SecretIdentity.cs │ ├── SamuraiApp.sln │ ├── SomeUI │ │ ├── App.config │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SomeUI.csproj │ │ └── packages.config │ └── Tests │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Tests.csproj │ │ ├── UnitTest1.cs │ │ └── packages.config │ └── SamuraiCoreApp │ ├── SamuraiApp.Data │ ├── Migrations │ │ ├── 20181229230745_initial.Designer.cs │ │ ├── 20181229230745_initial.cs │ │ ├── 20181229231155_relationships.Designer.cs │ │ ├── 20181229231155_relationships.cs │ │ └── SamuraiContextModelSnapshot.cs │ ├── SamuraiApp.Data.csproj │ └── SamuraiContext.cs │ ├── SamuraiApp.Domain │ ├── Battle.cs │ ├── Quote.cs │ ├── Samurai.cs │ ├── SamuraiApp.Domain.csproj │ ├── SamuraiBattle.cs │ └── SecretIdentity.cs │ ├── SamuraiCoreApp.sln │ ├── SomeUI │ ├── Program.cs │ └── SomeUI.csproj │ └── WebApp │ ├── Controllers │ └── HomeController.cs │ ├── Models │ └── ErrorViewModel.cs │ ├── Program.cs │ ├── Properties │ └── launchSettings.json │ ├── Startup.cs │ ├── Views │ ├── Home │ │ ├── About.cshtml │ │ ├── Contact.cshtml │ │ └── Index.cshtml │ ├── Shared │ │ ├── Error.cshtml │ │ ├── _Layout.cshtml │ │ └── _ValidationScriptsPartial.cshtml │ ├── _ViewImports.cshtml │ └── _ViewStart.cshtml │ ├── WebApp.csproj │ ├── appsettings.Development.json │ ├── appsettings.json │ ├── bundleconfig.json │ └── wwwroot │ ├── css │ ├── site.css │ └── site.min.css │ ├── favicon.ico │ ├── images │ ├── banner1.svg │ ├── banner2.svg │ ├── banner3.svg │ └── banner4.svg │ ├── js │ ├── site.js │ └── site.min.js │ └── lib │ ├── bootstrap │ ├── .bower.json │ ├── LICENSE │ └── dist │ │ ├── css │ │ ├── bootstrap-theme.css │ │ ├── bootstrap-theme.css.map │ │ ├── bootstrap-theme.min.css │ │ ├── bootstrap-theme.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.svg │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ │ └── js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ └── npm.js │ ├── jquery-validation-unobtrusive │ ├── .bower.json │ ├── jquery.validate.unobtrusive.js │ └── jquery.validate.unobtrusive.min.js │ ├── jquery-validation │ ├── .bower.json │ ├── LICENSE.md │ └── dist │ │ ├── additional-methods.js │ │ ├── additional-methods.min.js │ │ ├── jquery.validate.js │ │ └── jquery.validate.min.js │ └── jquery │ ├── .bower.json │ ├── LICENSE.txt │ └── dist │ ├── jquery.js │ ├── jquery.min.js │ └── jquery.min.map ├── M3Downloads (Interacting with ...) ├── After │ └── SamuraiApp │ │ ├── SamuraiApp.Data │ │ ├── Migrations │ │ │ ├── 20171117193749_initial.Designer.cs │ │ │ ├── 20171117193749_initial.cs │ │ │ ├── 20171125220938_relationships.Designer.cs │ │ │ ├── 20171125220938_relationships.cs │ │ │ └── SamuraiContextModelSnapshot.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SamuraiApp.Data.csproj │ │ ├── SamuraiContext.cs │ │ ├── app.config │ │ └── packages.config │ │ ├── SamuraiApp.Domain │ │ ├── Battle.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Quote.cs │ │ ├── Samurai.cs │ │ ├── SamuraiApp.Domain.csproj │ │ ├── SamuraiBattle.cs │ │ └── SecretIdentity.cs │ │ ├── SamuraiApp.sln │ │ ├── SomeUI │ │ ├── App.config │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SomeUI.csproj │ │ └── packages.config │ │ └── Tests │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Tests.csproj │ │ ├── UnitTest1.cs │ │ └── packages.config └── Before │ └── SamuraiApp │ ├── SamuraiApp.Data │ ├── Migrations │ │ ├── 20171117193749_initial.Designer.cs │ │ ├── 20171117193749_initial.cs │ │ ├── 20171125220938_relationships.Designer.cs │ │ ├── 20171125220938_relationships.cs │ │ └── SamuraiContextModelSnapshot.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SamuraiApp.Data.csproj │ ├── SamuraiContext.cs │ ├── app.config │ └── packages.config │ ├── SamuraiApp.Domain │ ├── Battle.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Quote.cs │ ├── Samurai.cs │ ├── SamuraiApp.Domain.csproj │ ├── SamuraiBattle.cs │ └── SecretIdentity.cs │ ├── SamuraiApp.sln │ ├── SomeUI │ ├── App.config │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SomeUI.csproj │ └── packages.config │ └── Tests │ ├── Properties │ └── AssemblyInfo.cs │ ├── Tests.csproj │ ├── UnitTest1.cs │ └── packages.config ├── M4Downloads (Querying and ...) ├── After │ └── SamuraiApp │ │ ├── SamuraiApp.Data │ │ ├── Migrations │ │ │ ├── 20171117193749_initial.Designer.cs │ │ │ ├── 20171117193749_initial.cs │ │ │ ├── 20171125220938_relationships.Designer.cs │ │ │ ├── 20171125220938_relationships.cs │ │ │ ├── 20171213161449_AddSprocs.Designer.cs │ │ │ ├── 20171213161449_AddSprocs.cs │ │ │ └── SamuraiContextModelSnapshot.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SamuraiApp.Data.csproj │ │ ├── SamuraiContext.cs │ │ ├── app.config │ │ └── packages.config │ │ ├── SamuraiApp.Domain │ │ ├── Battle.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Quote.cs │ │ ├── Samurai.cs │ │ ├── SamuraiApp.Domain.csproj │ │ ├── SamuraiBattle.cs │ │ └── SecretIdentity.cs │ │ ├── SamuraiApp.sln │ │ ├── SomeUI │ │ ├── App.config │ │ ├── Program.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SomeUI.csproj │ │ └── packages.config │ │ └── Tests │ │ ├── Properties │ │ └── AssemblyInfo.cs │ │ ├── Tests.csproj │ │ ├── UnitTest1.cs │ │ └── packages.config └── Where is the before code.txt ├── M5Downloads (Using in Apps...) ├── After │ ├── SamuraiCoreApp Web │ │ ├── SamuraiApp.Data │ │ │ ├── Migrations │ │ │ │ ├── 20171124153852_initial.Designer.cs │ │ │ │ ├── 20171124153852_initial.cs │ │ │ │ ├── 20180109183740_relationships.Designer.cs │ │ │ │ ├── 20180109183740_relationships.cs │ │ │ │ └── SamuraiContextModelSnapshot.cs │ │ │ ├── SamuraiApp.Data.csproj │ │ │ └── SamuraiContext.cs │ │ ├── SamuraiApp.Domain │ │ │ ├── Battle.cs │ │ │ ├── Quote.cs │ │ │ ├── Samurai.cs │ │ │ ├── SamuraiApp.Domain.csproj │ │ │ ├── SamuraiBattle.cs │ │ │ └── SecretIdentity.cs │ │ ├── SamuraiCoreApp.sln │ │ └── WebApp │ │ │ ├── Controllers │ │ │ ├── HomeController.cs │ │ │ ├── QuotesController.cs │ │ │ └── SamuraisController.cs │ │ │ ├── Models │ │ │ └── ErrorViewModel.cs │ │ │ ├── Program.cs │ │ │ ├── Properties │ │ │ └── launchSettings.json │ │ │ ├── Startup.cs │ │ │ ├── Views │ │ │ ├── Home │ │ │ │ ├── About.cshtml │ │ │ │ ├── Contact.cshtml │ │ │ │ └── Index.cshtml │ │ │ ├── Quotes │ │ │ │ ├── Create.cshtml │ │ │ │ ├── Delete.cshtml │ │ │ │ ├── Details.cshtml │ │ │ │ ├── Edit.cshtml │ │ │ │ └── Index.cshtml │ │ │ ├── Samurais │ │ │ │ ├── Create.cshtml │ │ │ │ ├── Delete.cshtml │ │ │ │ ├── Details.cshtml │ │ │ │ ├── Edit.cshtml │ │ │ │ └── Index.cshtml │ │ │ ├── Shared │ │ │ │ ├── Error.cshtml │ │ │ │ ├── _Layout.cshtml │ │ │ │ └── _ValidationScriptsPartial.cshtml │ │ │ ├── _ViewImports.cshtml │ │ │ └── _ViewStart.cshtml │ │ │ ├── WebApp.csproj │ │ │ ├── appsettings.Development.json │ │ │ ├── appsettings.json │ │ │ ├── bundleconfig.json │ │ │ └── wwwroot │ │ │ ├── css │ │ │ ├── site.css │ │ │ └── site.min.css │ │ │ ├── favicon.ico │ │ │ ├── images │ │ │ ├── banner1.svg │ │ │ ├── banner2.svg │ │ │ ├── banner3.svg │ │ │ └── banner4.svg │ │ │ ├── js │ │ │ ├── site.js │ │ │ └── site.min.js │ │ │ └── lib │ │ │ ├── bootstrap │ │ │ ├── .bower.json │ │ │ ├── LICENSE │ │ │ └── dist │ │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap-theme.min.css.map │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ ├── bootstrap.min.css │ │ │ │ └── bootstrap.min.css.map │ │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ │ ├── jquery-validation-unobtrusive │ │ │ ├── .bower.json │ │ │ ├── jquery.validate.unobtrusive.js │ │ │ └── jquery.validate.unobtrusive.min.js │ │ │ ├── jquery-validation │ │ │ ├── .bower.json │ │ │ ├── LICENSE.md │ │ │ └── dist │ │ │ │ ├── additional-methods.js │ │ │ │ ├── additional-methods.min.js │ │ │ │ ├── jquery.validate.js │ │ │ │ └── jquery.validate.min.js │ │ │ └── jquery │ │ │ ├── .bower.json │ │ │ ├── LICENSE.txt │ │ │ └── dist │ │ │ ├── jquery.js │ │ │ ├── jquery.min.js │ │ │ └── jquery.min.map │ └── SamuraiWpfApp │ │ ├── SamuraiApp.Data │ │ ├── ConnectedData.cs │ │ ├── Migrations │ │ │ ├── 20171117193749_initial.Designer.cs │ │ │ ├── 20171117193749_initial.cs │ │ │ ├── 20171125220938_relationships.Designer.cs │ │ │ ├── 20171125220938_relationships.cs │ │ │ └── SamuraiContextModelSnapshot.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── SamuraiApp.Data.csproj │ │ ├── SamuraiContext.cs │ │ ├── app.config │ │ └── packages.config │ │ ├── SamuraiApp.Domain │ │ ├── Battle.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Quote.cs │ │ ├── Samurai.cs │ │ ├── SamuraiApp.Domain.csproj │ │ ├── SamuraiBattle.cs │ │ └── SecretIdentity.cs │ │ ├── SamuraiWpfApp.sln │ │ └── SamuraiWpfUI │ │ ├── App.config │ │ ├── App.xaml │ │ ├── App.xaml.cs │ │ ├── MainWindow.xaml │ │ ├── MainWindow.xaml.cs │ │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── DataSources │ │ │ └── SamuraiApp.Domain.Samurai.datasource │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ │ ├── SamuraiWpfUI.csproj │ │ └── packages.config └── Before │ ├── SamuraiCoreApp Web │ ├── SamuraiApp.Data │ │ ├── Migrations │ │ │ ├── 20171124153852_initial.Designer.cs │ │ │ ├── 20171124153852_initial.cs │ │ │ └── SamuraiContextModelSnapshot.cs │ │ ├── SamuraiApp.Data.csproj │ │ └── SamuraiContext.cs │ ├── SamuraiApp.Domain │ │ ├── Battle.cs │ │ ├── Quote.cs │ │ ├── Samurai.cs │ │ ├── SamuraiApp.Domain.csproj │ │ ├── SamuraiBattle.cs │ │ └── SecretIdentity.cs │ ├── SamuraiCoreApp.sln │ └── WebApp │ │ ├── Controllers │ │ └── HomeController.cs │ │ ├── Models │ │ └── ErrorViewModel.cs │ │ ├── Program.cs │ │ ├── Properties │ │ └── launchSettings.json │ │ ├── Startup.cs │ │ ├── Views │ │ ├── Home │ │ │ ├── About.cshtml │ │ │ ├── Contact.cshtml │ │ │ └── Index.cshtml │ │ ├── Shared │ │ │ ├── Error.cshtml │ │ │ ├── _Layout.cshtml │ │ │ └── _ValidationScriptsPartial.cshtml │ │ ├── _ViewImports.cshtml │ │ └── _ViewStart.cshtml │ │ ├── WebApp.csproj │ │ ├── appsettings.Development.json │ │ ├── appsettings.json │ │ ├── bundleconfig.json │ │ └── wwwroot │ │ ├── css │ │ ├── site.css │ │ └── site.min.css │ │ ├── favicon.ico │ │ ├── images │ │ ├── banner1.svg │ │ ├── banner2.svg │ │ ├── banner3.svg │ │ └── banner4.svg │ │ ├── js │ │ ├── site.js │ │ └── site.min.js │ │ └── lib │ │ ├── bootstrap │ │ ├── .bower.json │ │ ├── LICENSE │ │ └── dist │ │ │ ├── css │ │ │ ├── bootstrap-theme.css │ │ │ ├── bootstrap-theme.css.map │ │ │ ├── bootstrap-theme.min.css │ │ │ ├── bootstrap-theme.min.css.map │ │ │ ├── bootstrap.css │ │ │ ├── bootstrap.css.map │ │ │ ├── bootstrap.min.css │ │ │ └── bootstrap.min.css.map │ │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ ├── bootstrap.js │ │ │ ├── bootstrap.min.js │ │ │ └── npm.js │ │ ├── jquery-validation-unobtrusive │ │ ├── .bower.json │ │ ├── jquery.validate.unobtrusive.js │ │ └── jquery.validate.unobtrusive.min.js │ │ ├── jquery-validation │ │ ├── .bower.json │ │ ├── LICENSE.md │ │ └── dist │ │ │ ├── additional-methods.js │ │ │ ├── additional-methods.min.js │ │ │ ├── jquery.validate.js │ │ │ └── jquery.validate.min.js │ │ └── jquery │ │ ├── .bower.json │ │ ├── LICENSE.txt │ │ └── dist │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── jquery.min.map │ └── SamuraiWpfApp │ ├── SamuraiApp.Data │ ├── ConnectedData.cs │ ├── Migrations │ │ ├── 20171117193749_initial.Designer.cs │ │ ├── 20171117193749_initial.cs │ │ ├── 20171125220938_relationships.Designer.cs │ │ ├── 20171125220938_relationships.cs │ │ └── SamuraiContextModelSnapshot.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── SamuraiApp.Data.csproj │ ├── SamuraiContext.cs │ ├── app.config │ └── packages.config │ ├── SamuraiApp.Domain │ ├── Battle.cs │ ├── InMemoryChangeTracker.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ ├── Quote.cs │ ├── Samurai.cs │ ├── SamuraiApp.Domain.csproj │ ├── SamuraiBattle.cs │ └── SecretIdentity.cs │ └── SamuraiWpfApp.sln └── README.md /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Data/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("SamuraiApp.Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("72d65b38-7cae-40c6-8ba2-d5e240d0e042")] 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 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Data/SamuraiContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using SamuraiApp.Domain; 3 | 4 | namespace SamuraiApp.Data 5 | { 6 | public class SamuraiContext:DbContext 7 | { 8 | public DbSet Samurais { get; set; } 9 | public DbSet Quotes { get; set; } 10 | public DbSet Battles { get; set; } 11 | 12 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 13 | { 14 | optionsBuilder.UseSqlServer( 15 | "Server = (localdb)\\mssqllocaldb; Database = SamuraiAppData; Trusted_Connection = True; "); 16 | } 17 | 18 | protected override void OnModelCreating(ModelBuilder modelBuilder) 19 | { 20 | modelBuilder.Entity() 21 | .HasKey(s => new { s.SamuraiId, s.BattleId }); 22 | 23 | 24 | base.OnModelCreating(modelBuilder); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Data/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; private set; } 11 | public DateTime EndDate { get; private set; } 12 | //public List Samurais { get; set; } 13 | public List SamuraiBattles { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Domain/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("SamuraiApp.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("15474cfa-9e4d-4ca6-9a4e-3cab6f17d676")] 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 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | Quotes = new List(); 10 | } 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | public List Quotes { get; set; } 14 | //public int BattleId { get; set; } 15 | public List SamuraiBattles { get; set; } 16 | public SecretIdentity SecretIdentity { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Domain/SamuraiApp.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676} 8 | Library 9 | Properties 10 | SamuraiApp.Domain 11 | SamuraiApp.Domain 12 | v4.7 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SomeUI/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 SomeUI 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/SomeUI/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("SomeUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SomeUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("b502961d-d37e-4614-be7c-7e3a26a1b3de")] 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 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("Tests")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("Tests")] 10 | [assembly: AssemblyCopyright("Copyright © 2017")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("0554f118-ae90-40ea-b19b-acdbaff61d35")] 17 | 18 | // [assembly: AssemblyVersion("1.0.*")] 19 | [assembly: AssemblyVersion("1.0.0.0")] 20 | [assembly: AssemblyFileVersion("1.0.0.0")] 21 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Tests 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiApp/Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiApp.Data/SamuraiApp.Data.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiApp.Data/SamuraiContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using SamuraiApp.Domain; 3 | 4 | namespace SamuraiApp.Data 5 | { 6 | public class SamuraiContext:DbContext 7 | { 8 | public SamuraiContext(DbContextOptions options) 9 | : base(options) 10 | { } 11 | 12 | public DbSet Samurais { get; set; } 13 | public DbSet Quotes { get; set; } 14 | public DbSet Battles { get; set; } 15 | 16 | protected override void OnModelCreating 17 | (ModelBuilder modelBuilder) 18 | { 19 | modelBuilder.Entity() 20 | .HasKey(s => new 21 | { 22 | s.BattleId, 23 | s.SamuraiId 24 | }); 25 | } 26 | 27 | //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 28 | //{ 29 | // optionsBuilder.UseSqlServer( 30 | // "Server = (localdb)\\mssqllocaldb; Database = SamuraiAppData; Trusted_Connection = True; "); 31 | //} 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; private set; } 11 | public DateTime EndDate { get; private set; } 12 | //public List Samurais { get; set; } 13 | public List SamuraiBattles { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | Quotes = new List(); 10 | } 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | public List Quotes { get; set; } 14 | //public int BattleId { get; set; } 15 | public List SamuraiBattles { get; set; } 16 | public SecretIdentity SecretIdentity { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiApp.Domain/SamuraiApp.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SamuraiCoreApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2009 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiApp.Domain", "SamuraiApp.Domain\SamuraiApp.Domain.csproj", "{C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiApp.Data", "SamuraiApp.Data\SamuraiApp.Data.csproj", "{08A86D62-C271-4F62-A0F2-252D2A9B5F49}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApp", "WebApp\WebApp.csproj", "{2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {AE3B058E-E94B-4A95-A8FC-F62E9F105B12} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SomeUI/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SomeUI 4 | { 5 | class Program 6 | { 7 | static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World!"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/SomeUI/SomeUI.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp2.0 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/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 WebApp.Models; 8 | 9 | namespace WebApp.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult About() 19 | { 20 | ViewData["Message"] = "Your application description page."; 21 | 22 | return View(); 23 | } 24 | 25 | public IActionResult Contact() 26 | { 27 | ViewData["Message"] = "Your contact page."; 28 | 29 | return View(); 30 | } 31 | 32 | public IActionResult Error() 33 | { 34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebApp.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace WebApp 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | BuildWebHost(args).Run(); 18 | } 19 | 20 | public static IWebHost BuildWebHost(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup() 23 | .Build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:25330/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebApp": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:25331/" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/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.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using SamuraiApp.Data; 10 | using Microsoft.EntityFrameworkCore; 11 | 12 | namespace WebApp 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.AddMvc(); 27 | services.AddDbContext( 28 | options => options.UseSqlServer( 29 | Configuration.GetConnectionString("SamuraiConnection"))); 30 | } 31 | 32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 34 | { 35 | if (env.IsDevelopment()) 36 | { 37 | app.UseDeveloperExceptionPage(); 38 | //app.UseBrowserLink(); 39 | } 40 | else 41 | { 42 | app.UseExceptionHandler("/Home/Error"); 43 | } 44 | 45 | app.UseStaticFiles(); 46 | 47 | app.UseMvc(routes => 48 | { 49 | routes.MapRoute( 50 | name: "default", 51 | template: "{controller=Home}/{action=Index}/{id?}"); 52 | }); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/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 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 22 |

23 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp 2 | @using WebApp.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/WebApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | }, 8 | 9 | "ConnectionStrings": { 10 | "SamuraiConnection": "Server=(localdb)\\mssqllocaldb;Database=SamuraiAppDataCore;Trusted_Connection=True;MultipleActiveResultSets=true" 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Carousel */ 14 | .carousel-caption p { 15 | font-size: 20px; 16 | line-height: 1.4; 17 | } 18 | 19 | /* Make .svg files in the carousel display properly in older browsers */ 20 | .carousel-inner .item img[src$=".svg"] { 21 | width: 100%; 22 | } 23 | 24 | /* QR code generator */ 25 | #qrCode { 26 | margin: 15px; 27 | } 28 | 29 | /* Hide/rearrange for smaller screens */ 30 | @media screen and (max-width: 767px) { 31 | /* Hide captions */ 32 | .carousel-caption { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your JavaScript code. 2 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/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 | -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /M2Downloads (Creating a ...)/After/SamuraiCoreApp/WebApp/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 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 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Data/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("SamuraiApp.Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("72d65b38-7cae-40c6-8ba2-d5e240d0e042")] 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 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Data/SamuraiContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.Extensions.DependencyInjection; //<-- part of the new logging implementation 3 | using Microsoft.Extensions.Logging; 4 | //using Microsoft.Extensions.Logging.Console;//<-- no longer needed for new logging implementation 5 | using SamuraiApp.Domain; 6 | 7 | namespace SamuraiApp.Data 8 | { 9 | public class SamuraiContext:DbContext 10 | { 11 | 12 | //note the newer way to set up logging below in the constructor 13 | //this more readable code arrived in .net core 2.2. It will 14 | //be simplified further in 3.0. 15 | 16 | //public static readonly LoggerFactory MyConsoleLoggerFactory 17 | // = new LoggerFactory(new[] { 18 | // new ConsoleLoggerProvider((category, level) 19 | // => category == DbLoggerCategory.Database.Command.Name 20 | // && level == LogLevel.Information, true) }); 21 | 22 | 23 | private ILoggerFactory MyConsoleLoggerFactory; //<--this is part of the new 2.2 implementation 24 | 25 | public SamuraiContext() 26 | { 27 | IServiceCollection serviceCollection = new ServiceCollection(); 28 | serviceCollection.AddLogging(builder => builder 29 | .AddConsole() 30 | .AddFilter 31 | (DbLoggerCategory.Database.Command.Name, LogLevel.Information)); 32 | 33 | MyConsoleLoggerFactory = serviceCollection.BuildServiceProvider().GetService(); 34 | } 35 | 36 | public DbSet Samurais { get; set; } 37 | public DbSet Quotes { get; set; } 38 | public DbSet Battles { get; set; } 39 | 40 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 41 | { 42 | optionsBuilder 43 | .UseLoggerFactory(MyConsoleLoggerFactory) 44 | .EnableSensitiveDataLogging(true) 45 | .UseSqlServer( 46 | "Server = (localdb)\\mssqllocaldb; Database = SamuraiAppData; Trusted_Connection = True; "); 47 | } 48 | 49 | protected override void OnModelCreating(ModelBuilder modelBuilder) 50 | { 51 | modelBuilder.Entity() 52 | .HasKey(s => new { s.SamuraiId, s.BattleId }); 53 | base.OnModelCreating(modelBuilder); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Data/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; set; } 11 | public DateTime EndDate { get; set; } 12 | public List SamuraiBattles { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Domain/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("SamuraiApp.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("15474cfa-9e4d-4ca6-9a4e-3cab6f17d676")] 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 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | Quotes = new List(); 10 | } 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | public List Quotes { get; set; } 14 | public List SamuraiBattles { get; set; } 15 | public SecretIdentity SecretIdentity { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Domain/SamuraiApp.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676} 8 | Library 9 | Properties 10 | SamuraiApp.Domain 11 | SamuraiApp.Domain 12 | v4.7 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/SomeUI/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("SomeUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SomeUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("b502961d-d37e-4614-be7c-7e3a26a1b3de")] 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 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("Tests")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("Tests")] 10 | [assembly: AssemblyCopyright("Copyright © 2017")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("0554f118-ae90-40ea-b19b-acdbaff61d35")] 17 | 18 | // [assembly: AssemblyVersion("1.0.*")] 19 | [assembly: AssemblyVersion("1.0.0.0")] 20 | [assembly: AssemblyFileVersion("1.0.0.0")] 21 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Tests 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/After/SamuraiApp/Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Data/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("SamuraiApp.Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("72d65b38-7cae-40c6-8ba2-d5e240d0e042")] 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 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Data/SamuraiContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | //using Microsoft.Extensions.DependencyInjection; 3 | //using Microsoft.Extensions.Logging; 4 | 5 | using SamuraiApp.Domain; 6 | 7 | namespace SamuraiApp.Data 8 | { 9 | public class SamuraiContext:DbContext 10 | { 11 | public DbSet Samurais { get; set; } 12 | public DbSet Quotes { get; set; } 13 | public DbSet Battles { get; set; } 14 | 15 | ////dotnet Core 2.2 brings a new way to implement logging which is simpler 16 | ////than what you'll see in the video. Therefore I'm leaving the NEWER code here so you can 17 | ////just uncomment it as needed. Note that I have also added some usings above (also commented) 18 | ////to go with the following code. 19 | ////In the video you will also use the MyConsoleLoggerFactory defined below in onconfiguring, but that step will be the same. 20 | ////You'll still need to follow the step (from the video) to add Microsoft.Extensions.Logging.Console although the 'using' statement will not be needed 21 | 22 | //private ILoggerFactory MyConsoleLoggerFactory; //<--this is part of the new 2.2 implementation 23 | 24 | //public SamuraiContext() 25 | //{ 26 | // IServiceCollection serviceCollection = new ServiceCollection(); 27 | // serviceCollection.AddLogging(builder => builder 28 | // .AddConsole() 29 | // .AddFilter 30 | // (DbLoggerCategory.Database.Command.Name, LogLevel.Information)); 31 | 32 | // MyConsoleLoggerFactory = serviceCollection.BuildServiceProvider().GetService(); 33 | //} 34 | 35 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 36 | { 37 | optionsBuilder.UseSqlServer( 38 | "Server = (localdb)\\mssqllocaldb; Database = SamuraiAppData; Trusted_Connection = True; "); 39 | } 40 | 41 | protected override void OnModelCreating(ModelBuilder modelBuilder) 42 | { 43 | modelBuilder.Entity() 44 | .HasKey(s => new { s.SamuraiId, s.BattleId }); 45 | base.OnModelCreating(modelBuilder); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Data/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; private set; } 11 | public DateTime EndDate { get; private set; } 12 | public List SamuraiBattles { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Domain/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("SamuraiApp.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("15474cfa-9e4d-4ca6-9a4e-3cab6f17d676")] 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 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | Quotes = new List(); 10 | } 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | public List Quotes { get; set; } 14 | public List SamuraiBattles { get; set; } 15 | public SecretIdentity SecretIdentity { get; set; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Domain/SamuraiApp.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676} 8 | Library 9 | Properties 10 | SamuraiApp.Domain 11 | SamuraiApp.Domain 12 | v4.7 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SomeUI/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 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 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SomeUI/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 SomeUI 8 | { 9 | class Program 10 | { 11 | static void Main(string[] args) 12 | { 13 | 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/SomeUI/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("SomeUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SomeUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("b502961d-d37e-4614-be7c-7e3a26a1b3de")] 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 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("Tests")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("Tests")] 10 | [assembly: AssemblyCopyright("Copyright © 2017")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("0554f118-ae90-40ea-b19b-acdbaff61d35")] 17 | 18 | // [assembly: AssemblyVersion("1.0.*")] 19 | [assembly: AssemblyVersion("1.0.0.0")] 20 | [assembly: AssemblyFileVersion("1.0.0.0")] 21 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Tests 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M3Downloads (Interacting with ...)/Before/SamuraiApp/Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Data/Migrations/20171213161449_AddSprocs.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore.Migrations; 2 | 3 | namespace SamuraiApp.Data.Migrations 4 | { 5 | public partial class AddSprocs : Migration { 6 | protected override void Up(MigrationBuilder migrationBuilder) 7 | { 8 | migrationBuilder.Sql( 9 | @"CREATE PROCEDURE FilterSamuraiByNamePart 10 | @namepart varchar(50) 11 | AS 12 | select * from samurais where name like '%'+@namepart+'%'"); 13 | migrationBuilder.Sql( 14 | @"create procedure FindLongestName 15 | @procResult varchar(50) OUTPUT 16 | AS 17 | BEGIN 18 | SET NOCOUNT ON; 19 | select top 1 @procResult= name from samurais order by len(name) desc 20 | END" 21 | ); 22 | } 23 | protected override void Down(MigrationBuilder migrationBuilder) { 24 | migrationBuilder.Sql("DROP PROCEDURE FindLongestName"); 25 | migrationBuilder.Sql("drop procedure FilterSamuraiByNamePart"); 26 | 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Data/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("SamuraiApp.Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("72d65b38-7cae-40c6-8ba2-d5e240d0e042")] 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 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Data/SamuraiContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.Extensions.DependencyInjection; //used for new logging API 3 | using Microsoft.Extensions.Logging; 4 | //using Microsoft.Extensions.Logging.Console; //no longer needed with new logging API 5 | using SamuraiApp.Domain; 6 | 7 | namespace SamuraiApp.Data 8 | { 9 | public class SamuraiContext:DbContext 10 | { 11 | 12 | //note the newer way to set up logging below in the constructor 13 | //this more readable code arrived in .net core 2.2. It will 14 | //be simplified further in 3.0. 15 | 16 | //public static readonly LoggerFactory MyConsoleLoggerFactory 17 | // = new LoggerFactory(new[] { 18 | // new ConsoleLoggerProvider((category, level) 19 | // => category == DbLoggerCategory.Database.Command.Name 20 | // && level == LogLevel.Information, true) }); 21 | 22 | 23 | private ILoggerFactory MyConsoleLoggerFactory; //<--this is part of the new 2.2 implementation 24 | 25 | public SamuraiContext() 26 | { 27 | IServiceCollection serviceCollection = new ServiceCollection(); 28 | serviceCollection.AddLogging(builder => builder 29 | .AddConsole() 30 | .AddFilter 31 | (DbLoggerCategory.Database.Command.Name, LogLevel.Information)); 32 | 33 | MyConsoleLoggerFactory = serviceCollection.BuildServiceProvider().GetService(); 34 | } 35 | 36 | public DbSet Samurais { get; set; } 37 | public DbSet Quotes { get; set; } 38 | public DbSet Battles { get; set; } 39 | 40 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 41 | { 42 | optionsBuilder 43 | .UseLoggerFactory(MyConsoleLoggerFactory) 44 | .EnableSensitiveDataLogging(true) 45 | .UseSqlServer( 46 | "Server = (localdb)\\mssqllocaldb; Database = SamuraiAppData; Trusted_Connection = True; "); 47 | } 48 | 49 | protected override void OnModelCreating(ModelBuilder modelBuilder) 50 | { 51 | modelBuilder.Entity() 52 | .HasKey(s => new { s.SamuraiId, s.BattleId }); 53 | 54 | 55 | base.OnModelCreating(modelBuilder); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Data/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; set; } 11 | public DateTime EndDate { get; set; } 12 | public List SamuraiBattles { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Domain/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("SamuraiApp.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("15474cfa-9e4d-4ca6-9a4e-3cab6f17d676")] 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 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | Quotes = new List(); 10 | } 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | public List Quotes { get; set; } 14 | //public int BattleId { get; set; } 15 | public List SamuraiBattles { get; set; } 16 | public SecretIdentity SecretIdentity { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Domain/SamuraiApp.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676} 8 | Library 9 | Properties 10 | SamuraiApp.Domain 11 | SamuraiApp.Domain 12 | v4.7 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SomeUI/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 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 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/SomeUI/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("SomeUI")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SomeUI")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("b502961d-d37e-4614-be7c-7e3a26a1b3de")] 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 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/Tests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("Tests")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("Tests")] 10 | [assembly: AssemblyCopyright("Copyright © 2017")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | 14 | [assembly: ComVisible(false)] 15 | 16 | [assembly: Guid("0554f118-ae90-40ea-b19b-acdbaff61d35")] 17 | 18 | // [assembly: AssemblyVersion("1.0.*")] 19 | [assembly: AssemblyVersion("1.0.0.0")] 20 | [assembly: AssemblyFileVersion("1.0.0.0")] 21 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/Tests/UnitTest1.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.VisualStudio.TestTools.UnitTesting; 3 | 4 | namespace Tests 5 | { 6 | [TestClass] 7 | public class UnitTest1 8 | { 9 | [TestMethod] 10 | public void TestMethod1() 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/After/SamuraiApp/Tests/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /M4Downloads (Querying and ...)/Where is the before code.txt: -------------------------------------------------------------------------------- 1 | In the 4th module (interacting with related data), you will start with the ending point of the previous module (interacting with simple objects). So this module's "BEFORE" is the same as the previous module's "AFTER". -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiApp.Data/SamuraiApp.Data.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiApp.Data/SamuraiContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using SamuraiApp.Domain; 3 | 4 | namespace SamuraiApp.Data 5 | { 6 | public class SamuraiContext:DbContext 7 | { 8 | public SamuraiContext(DbContextOptions options) 9 | : base(options) 10 | { } 11 | //note in the video I talked about an asp.net code gen problem that requires 12 | //explicit use of the entity namespaces but it seems to be fixed. At least 13 | //as I'm using VS2017 v15.9.4 14 | public DbSet Samurais { get; set; } 15 | public DbSet Quotes { get; set; } 16 | public DbSet Battles { get; set; } 17 | 18 | protected override void OnModelCreating(ModelBuilder modelBuilder) 19 | { 20 | modelBuilder.Entity() 21 | .HasKey(s => new { s.BattleId, s.SamuraiId }); 22 | base.OnModelCreating(modelBuilder); 23 | } 24 | 25 | //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 26 | //{ 27 | // optionsBuilder.UseSqlServer( 28 | // "Server = (localdb)\\mssqllocaldb; Database = SamuraiAppData; Trusted_Connection = True; "); 29 | //} 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; private set; } 11 | public DateTime EndDate { get; private set; } 12 | //public List Samurais { get; set; } 13 | public List SamuraiBattles { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | SecretIdentity = new SecretIdentity(); 10 | Quotes = new List(); 11 | } 12 | public int Id { get; set; } 13 | public string Name { get; set; } 14 | public List Quotes { get; set; } 15 | public List SamuraiBattles { get; set; } 16 | public SecretIdentity SecretIdentity { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiApp.Domain/SamuraiApp.Domain.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/SamuraiCoreApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2009 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiApp.Domain", "SamuraiApp.Domain\SamuraiApp.Domain.csproj", "{C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiApp.Data", "SamuraiApp.Data\SamuraiApp.Data.csproj", "{08A86D62-C271-4F62-A0F2-252D2A9B5F49}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApp", "WebApp\WebApp.csproj", "{2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {AE3B058E-E94B-4A95-A8FC-F62E9F105B12} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/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 WebApp.Models; 8 | 9 | namespace WebApp.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult About() 19 | { 20 | ViewData["Message"] = "Your application description page."; 21 | 22 | return View(); 23 | } 24 | 25 | public IActionResult Contact() 26 | { 27 | ViewData["Message"] = "Your contact page."; 28 | 29 | return View(); 30 | } 31 | 32 | public IActionResult Error() 33 | { 34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebApp.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace WebApp 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | BuildWebHost(args).Run(); 18 | } 19 | 20 | public static IWebHost BuildWebHost(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup() 23 | .Build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:25330/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "launchUrl": "Samurais", 15 | "environmentVariables": { 16 | "ASPNETCORE_ENVIRONMENT": "Development" 17 | } 18 | }, 19 | "WebApp": { 20 | "commandName": "Project", 21 | "launchBrowser": true, 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | }, 25 | "applicationUrl": "http://localhost:25331/" 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/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.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using SamuraiApp.Data; 10 | using Microsoft.EntityFrameworkCore; 11 | 12 | namespace WebApp 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.AddMvc(); 27 | services.AddDbContext( 28 | options => options.UseSqlServer( 29 | Configuration.GetConnectionString("SamuraiConnection"))); 30 | } 31 | 32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 34 | { 35 | if (env.IsDevelopment()) 36 | { 37 | app.UseDeveloperExceptionPage(); 38 | } 39 | else 40 | { 41 | app.UseExceptionHandler("/Home/Error"); 42 | } 43 | 44 | app.UseStaticFiles(); 45 | 46 | app.UseMvc(routes => 47 | { 48 | routes.MapRoute( 49 | name: "default", 50 | template: "{controller=Home}/{action=Index}/{id?}"); 51 | }); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Quotes/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model SamuraiApp.Domain.Quote 2 | 3 | @{ 4 | ViewData["Title"] = "Create"; 5 | } 6 | 7 |

Create

8 | 9 |

Quote

10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 | 23 |
24 |
25 | 26 |
27 |
28 |
29 |
30 | 31 |
32 | Back to Samurais 33 |
34 | 35 | @section Scripts { 36 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 37 | } 38 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Quotes/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model SamuraiApp.Domain.Quote 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Quote

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Text) 16 |
17 |
18 | @Html.DisplayFor(model => model.Text) 19 |
20 |
21 | @Html.DisplayNameFor(model => model.Samurai) 22 |
23 |
24 | @Html.DisplayFor(model => model.Samurai.Id) 25 |
26 |
27 | 28 |
29 | 30 | | 31 | Back to List 32 |
33 |
34 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Quotes/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model SamuraiApp.Domain.Quote 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

Quote

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Text) 15 |
16 |
17 | @Html.DisplayFor(model => model.Text) 18 |
19 |
20 | @Html.DisplayNameFor(model => model.Samurai) 21 |
22 |
23 | @Html.DisplayFor(model => model.Samurai.Id) 24 |
25 |
26 |
27 |
28 | Edit | 29 | Back to List 30 |
31 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Quotes/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model SamuraiApp.Domain.Quote 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | } 6 | 7 |

Edit

8 | 9 |

Quote

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 | Back to List 35 |
36 | 37 | @section Scripts { 38 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 39 | } 40 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Quotes/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | Create New 11 |

12 | 13 | 14 | 15 | 18 | 21 | 22 | 23 | 24 | 25 | @foreach (var item in Model) { 26 | 27 | 30 | 33 | 38 | 39 | } 40 | 41 |
16 | @Html.DisplayNameFor(model => model.Text) 17 | 19 | @Html.DisplayNameFor(model => model.Samurai) 20 |
28 | @Html.DisplayFor(modelItem => item.Text) 29 | 31 | @Html.DisplayFor(modelItem => item.Samurai.Id) 32 | 34 | Edit | 35 | Details | 36 | Delete 37 |
42 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Samurais/Create.cshtml: -------------------------------------------------------------------------------- 1 | @model SamuraiApp.Domain.Samurai 2 | 3 | @{ 4 | ViewData["Title"] = "Create"; 5 | } 6 | 7 |

Create

8 | 9 |

Samurai

10 |
11 |
12 |
13 |
14 |
15 |
16 | 17 | 18 | 19 |
20 |
21 | 22 |
23 |
24 |
25 |
26 | 27 |
28 | Back to List 29 |
30 | 31 | @section Scripts { 32 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 33 | } 34 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Samurais/Delete.cshtml: -------------------------------------------------------------------------------- 1 | @model SamuraiApp.Domain.Samurai 2 | 3 | @{ 4 | ViewData["Title"] = "Delete"; 5 | } 6 | 7 |

Delete

8 | 9 |

Are you sure you want to delete this?

10 |
11 |

Samurai

12 |
13 |
14 |
15 | @Html.DisplayNameFor(model => model.Name) 16 |
17 |
18 | @Html.DisplayFor(model => model.Name) 19 |
20 |
21 | 22 |
23 | 24 | | 25 | Back to List 26 |
27 |
28 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Samurais/Details.cshtml: -------------------------------------------------------------------------------- 1 | @model SamuraiApp.Domain.Samurai 2 | 3 | @{ 4 | ViewData["Title"] = "Details"; 5 | } 6 | 7 |

Details

8 | 9 |
10 |

Samurai

11 |
12 |
13 |
14 | @Html.DisplayNameFor(model => model.Name) 15 |
16 |
17 | @Html.DisplayFor(model => model.Name) 18 |
19 |
20 | @Html.DisplayNameFor(model => model.SecretIdentity.RealName) 21 |
22 |
23 | @Html.DisplayFor(model => model.SecretIdentity.RealName) 24 |
25 |
26 |
27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | @foreach (var item in Model.Quotes) 35 | { 36 | 37 | 38 | 39 | } 40 |
Quotes
@item.Text
41 |
42 | Edit | 43 | Back to List 44 |
45 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Samurais/Edit.cshtml: -------------------------------------------------------------------------------- 1 | @model SamuraiApp.Domain.Samurai 2 | 3 | @{ 4 | ViewData["Title"] = "Edit"; 5 | } 6 | 7 |

Edit

8 | 9 |

Samurai

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 | @foreach (var item in Model.Quotes) 45 | { 46 | 47 | 48 | 49 | 50 | } 51 |
Text
@item.Text @Html.ActionLink("Edit", "Edit", "Quotes", new { id = item.Id, samuraiId = item.SamuraiId }, null)
52 |
53 | 54 | @Html.ActionLink("New Quote", "Create", "Quotes", new { samuraiId = Model.Id }, null) | 55 | Back to Samurais List 56 |
57 | 58 | @section Scripts { 59 | @{await Html.RenderPartialAsync("_ValidationScriptsPartial");} 60 | } 61 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Samurais/Index.cshtml: -------------------------------------------------------------------------------- 1 | @model IEnumerable 2 | 3 | @{ 4 | ViewData["Title"] = "Index"; 5 | } 6 | 7 |

Index

8 | 9 |

10 | Create New 11 |

12 | 13 | 14 | 15 | 18 | 19 | 20 | 21 | 22 | @foreach (var item in Model) { 23 | 24 | 27 | 32 | 33 | } 34 | 35 |
16 | @Html.DisplayNameFor(model => model.Name) 17 |
25 | @Html.DisplayFor(modelItem => item.Name) 26 | 28 | Edit | 29 | Details | 30 | Delete 31 |
36 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/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 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 22 |

23 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp 2 | @using WebApp.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/WebApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | }, 8 | 9 | "ConnectionStrings": { 10 | "SamuraiConnection": "Server=(localdb)\\mssqllocaldb;Database=SamuraiAppDataCore;Trusted_Connection=True;MultipleActiveResultSets=true" 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Carousel */ 14 | .carousel-caption p { 15 | font-size: 20px; 16 | line-height: 1.4; 17 | } 18 | 19 | /* Make .svg files in the carousel display properly in older browsers */ 20 | .carousel-inner .item img[src$=".svg"] { 21 | width: 100%; 22 | } 23 | 24 | /* QR code generator */ 25 | #qrCode { 26 | margin: 15px; 27 | } 28 | 29 | /* Hide/rearrange for smaller screens */ 30 | @media screen and (max-width: 767px) { 31 | /* Hide captions */ 32 | .carousel-caption { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your JavaScript code. 2 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/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 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiCoreApp Web/WebApp/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 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 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Data/ConnectedData.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using SamuraiApp.Domain; 3 | using System.Collections.ObjectModel; 4 | using System.Linq; 5 | 6 | namespace SamuraiApp.Data 7 | { 8 | public class ConnectedData 9 | { 10 | private SamuraiContext _context; 11 | 12 | public ConnectedData() 13 | { 14 | _context = new SamuraiContext(); 15 | _context.Database.Migrate(); 16 | } 17 | 18 | public Samurai CreateNewSamurai() 19 | { 20 | var samurai = new Samurai { Name = "New Samurai" }; 21 | _context.Samurais.Add(samurai); 22 | return samurai; 23 | } 24 | 25 | public ObservableCollection SamuraisListInMemory() 26 | { 27 | if (_context.Samurais.Local.Count == 0) 28 | { 29 | _context.Samurais.ToList(); 30 | } 31 | return _context.Samurais.Local.ToObservableCollection(); 32 | } 33 | 34 | public Samurai LoadSamuraiGraph(int samuraiId) 35 | { 36 | var samurai = _context.Samurais.Find(samuraiId); //gets from tracker if its there 37 | _context.Entry(samurai).Reference(s => s.SecretIdentity).Load(); 38 | _context.Entry(samurai).Collection(s => s.Quotes).Load(); 39 | 40 | return samurai; 41 | } 42 | 43 | public bool ChangesNeedToBeSaved() 44 | { 45 | return _context.ChangeTracker.Entries() 46 | .Any(e => e.State == EntityState.Added 47 | | e.State == EntityState.Modified 48 | | e.State == EntityState.Deleted); 49 | } 50 | 51 | public void SaveChanges() 52 | { 53 | _context.SaveChanges(); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Data/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("SamuraiApp.Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("72d65b38-7cae-40c6-8ba2-d5e240d0e042")] 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 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Data/SamuraiContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using Microsoft.Extensions.DependencyInjection; //ref needed for 2.2 logging implementation 3 | using Microsoft.Extensions.Logging; 4 | //using Microsoft.Extensions.Logging.Console; //package is needed but this reference is no longer needed with 2.2 5 | using SamuraiApp.Domain; 6 | using System.Configuration; 7 | 8 | namespace SamuraiApp.Data 9 | { 10 | public class SamuraiContext:DbContext 11 | { 12 | //note the newer way to set up logging below in the constructor 13 | //this more readable code arrived in .net core 2.2. It will 14 | //be simplified further in 3.0. 15 | 16 | //public static readonly LoggerFactory MyConsoleLoggerFactory 17 | // = new LoggerFactory(new[] { 18 | // new ConsoleLoggerProvider((category, level) 19 | // => category == DbLoggerCategory.Database.Command.Name 20 | // && level == LogLevel.Information, true) }); 21 | 22 | 23 | private ILoggerFactory MyConsoleLoggerFactory; //<--this is part of the new 2.2 implementation 24 | 25 | public SamuraiContext() 26 | { 27 | IServiceCollection serviceCollection = new ServiceCollection(); 28 | serviceCollection.AddLogging(builder => builder 29 | .AddConsole() 30 | .AddFilter 31 | (DbLoggerCategory.Database.Command.Name, LogLevel.Information)); 32 | 33 | MyConsoleLoggerFactory = serviceCollection.BuildServiceProvider().GetService(); 34 | } 35 | 36 | 37 | public DbSet Samurais { get; set; } 38 | public DbSet Quotes { get; set; } 39 | public DbSet Battles { get; set; } 40 | 41 | protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 42 | { 43 | var connectionString = ConfigurationManager.ConnectionStrings["WPFDatabase"].ToString(); 44 | optionsBuilder 45 | .UseLoggerFactory(MyConsoleLoggerFactory) 46 | .EnableSensitiveDataLogging(true) 47 | .UseSqlServer(connectionString); 48 | } 49 | 50 | protected override void OnModelCreating(ModelBuilder modelBuilder) 51 | { 52 | modelBuilder.Entity() 53 | .HasKey(s => new { s.SamuraiId, s.BattleId }); 54 | 55 | base.OnModelCreating(modelBuilder); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Data/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; set; } 11 | public DateTime EndDate { get; set; } 12 | public List SamuraiBattles { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Domain/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("SamuraiApp.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("15474cfa-9e4d-4ca6-9a4e-3cab6f17d676")] 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 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | Quotes = new List(); 10 | } 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | public List Quotes { get; set; } 14 | public List SamuraiBattles { get; set; } 15 | public SecretIdentity SecretIdentity { get; set; } 16 | 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Domain/SamuraiApp.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676} 8 | Library 9 | Properties 10 | SamuraiApp.Domain 11 | SamuraiApp.Domain 12 | v4.7 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiWpfApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiApp.Domain", "SamuraiApp.Domain\SamuraiApp.Domain.csproj", "{15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiApp.Data", "SamuraiApp.Data\SamuraiApp.Data.csproj", "{72D65B38-7CAE-40C6-8BA2-D5E240D0E042}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiWpfUI", "SamuraiWpfUI\SamuraiWpfUI.csproj", "{D53AA0B1-CD84-4CDC-817D-439BBE58FD6B}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {72D65B38-7CAE-40C6-8BA2-D5E240D0E042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {72D65B38-7CAE-40C6-8BA2-D5E240D0E042}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {72D65B38-7CAE-40C6-8BA2-D5E240D0E042}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {72D65B38-7CAE-40C6-8BA2-D5E240D0E042}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {D53AA0B1-CD84-4CDC-817D-439BBE58FD6B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {D53AA0B1-CD84-4CDC-817D-439BBE58FD6B}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {D53AA0B1-CD84-4CDC-817D-439BBE58FD6B}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {D53AA0B1-CD84-4CDC-817D-439BBE58FD6B}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {F16FED5C-6A7B-41F6-8BF4-58B791B0C26C} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiWpfUI/App.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 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 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiWpfUI/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiWpfUI/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Threading.Tasks; 7 | using System.Windows; 8 | 9 | namespace SamuraiWpfUI 10 | { 11 | /// 12 | /// Interaction logic for App.xaml 13 | /// 14 | public partial class App : Application 15 | { 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiWpfUI/Properties/DataSources/SamuraiApp.Domain.Samurai.datasource: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | SamuraiApp.Domain.Samurai, SamuraiApp.Domain, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 10 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiWpfUI/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace SamuraiWpfUI.Properties 12 | { 13 | 14 | 15 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 16 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] 17 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase 18 | { 19 | 20 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 21 | 22 | public static Settings Default 23 | { 24 | get 25 | { 26 | return defaultInstance; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/After/SamuraiWpfApp/SamuraiWpfUI/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiApp.Data/SamuraiApp.Data.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiApp.Data/SamuraiContext.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.EntityFrameworkCore; 2 | using SamuraiApp.Domain; 3 | 4 | namespace SamuraiApp.Data 5 | { 6 | public class SamuraiContext:DbContext 7 | { 8 | public SamuraiContext(DbContextOptions options) 9 | : base(options) 10 | { } 11 | 12 | //note in the video I talked about an asp.net code gen problem that requires 13 | //explicit use of the entity namespaces but it seems to be fixed. At least 14 | //as I'm using VS2017 v15.9.4 15 | public DbSet Samurais { get; set; } 16 | public DbSet Quotes { get; set; } 17 | public DbSet Battles { get; set; } 18 | 19 | protected override void OnModelCreating(ModelBuilder modelBuilder) 20 | { 21 | modelBuilder.Entity() 22 | .HasKey(s => new { s.BattleId, s.SamuraiId }); 23 | base.OnModelCreating(modelBuilder); 24 | } 25 | 26 | //protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) 27 | //{ 28 | // optionsBuilder.UseSqlServer( 29 | // "Server = (localdb)\\mssqllocaldb; Database = SamuraiAppData; Trusted_Connection = True; "); 30 | //} 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; private set; } 11 | public DateTime EndDate { get; private set; } 12 | //public List Samurais { get; set; } 13 | public List SamuraiBattles { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | Quotes = new List(); 10 | } 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | public List Quotes { get; set; } 14 | //public int BattleId { get; set; } 15 | public List SamuraiBattles { get; set; } 16 | public SecretIdentity SecretIdentity { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiApp.Domain/SamuraiApp.Domain.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/SamuraiCoreApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27004.2009 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SamuraiApp.Domain", "SamuraiApp.Domain\SamuraiApp.Domain.csproj", "{C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}" 7 | EndProject 8 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SamuraiApp.Data", "SamuraiApp.Data\SamuraiApp.Data.csproj", "{08A86D62-C271-4F62-A0F2-252D2A9B5F49}" 9 | EndProject 10 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApp", "WebApp\WebApp.csproj", "{2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}" 11 | EndProject 12 | Global 13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 14 | Debug|Any CPU = Debug|Any CPU 15 | Release|Any CPU = Release|Any CPU 16 | EndGlobalSection 17 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 18 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 19 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Debug|Any CPU.Build.0 = Debug|Any CPU 20 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {C1A889B6-69C2-453B-948A-CAA4A1CAD3D9}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {08A86D62-C271-4F62-A0F2-252D2A9B5F49}.Release|Any CPU.Build.0 = Release|Any CPU 26 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 27 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Debug|Any CPU.Build.0 = Debug|Any CPU 28 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Release|Any CPU.ActiveCfg = Release|Any CPU 29 | {2BE2EDC1-8F15-406E-911A-FADF67EA0E7B}.Release|Any CPU.Build.0 = Release|Any CPU 30 | EndGlobalSection 31 | GlobalSection(SolutionProperties) = preSolution 32 | HideSolutionNode = FALSE 33 | EndGlobalSection 34 | GlobalSection(ExtensibilityGlobals) = postSolution 35 | SolutionGuid = {AE3B058E-E94B-4A95-A8FC-F62E9F105B12} 36 | EndGlobalSection 37 | EndGlobal 38 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/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 WebApp.Models; 8 | 9 | namespace WebApp.Controllers 10 | { 11 | public class HomeController : Controller 12 | { 13 | public IActionResult Index() 14 | { 15 | return View(); 16 | } 17 | 18 | public IActionResult About() 19 | { 20 | ViewData["Message"] = "Your application description page."; 21 | 22 | return View(); 23 | } 24 | 25 | public IActionResult Contact() 26 | { 27 | ViewData["Message"] = "Your contact page."; 28 | 29 | return View(); 30 | } 31 | 32 | public IActionResult Error() 33 | { 34 | return View(new ErrorViewModel { RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier }); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/Models/ErrorViewModel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace WebApp.Models 4 | { 5 | public class ErrorViewModel 6 | { 7 | public string RequestId { get; set; } 8 | 9 | public bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 10 | } 11 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore; 7 | using Microsoft.AspNetCore.Hosting; 8 | using Microsoft.Extensions.Configuration; 9 | using Microsoft.Extensions.Logging; 10 | 11 | namespace WebApp 12 | { 13 | public class Program 14 | { 15 | public static void Main(string[] args) 16 | { 17 | BuildWebHost(args).Run(); 18 | } 19 | 20 | public static IWebHost BuildWebHost(string[] args) => 21 | WebHost.CreateDefaultBuilder(args) 22 | .UseStartup() 23 | .Build(); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:25330/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "WebApp": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "environmentVariables": { 22 | "ASPNETCORE_ENVIRONMENT": "Development" 23 | }, 24 | "applicationUrl": "http://localhost:25331/" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/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.Extensions.Configuration; 8 | using Microsoft.Extensions.DependencyInjection; 9 | using SamuraiApp.Data; 10 | using Microsoft.EntityFrameworkCore; 11 | 12 | namespace WebApp 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.AddMvc(); 27 | services.AddDbContext( 28 | options => options.UseSqlServer( 29 | Configuration.GetConnectionString("SamuraiConnection"))); 30 | } 31 | 32 | // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. 33 | public void Configure(IApplicationBuilder app, IHostingEnvironment env) 34 | { 35 | if (env.IsDevelopment()) 36 | { 37 | app.UseDeveloperExceptionPage(); 38 | 39 | } 40 | else 41 | { 42 | app.UseExceptionHandler("/Home/Error"); 43 | } 44 | 45 | app.UseStaticFiles(); 46 | 47 | app.UseMvc(routes => 48 | { 49 | routes.MapRoute( 50 | name: "default", 51 | template: "{controller=Home}/{action=Index}/{id?}"); 52 | }); 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/Views/Home/About.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "About"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |

Use this area to provide additional information.

8 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/Views/Home/Contact.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | ViewData["Title"] = "Contact"; 3 | } 4 |

@ViewData["Title"]

5 |

@ViewData["Message"]

6 | 7 |
8 | One Microsoft Way
9 | Redmond, WA 98052-6399
10 | P: 11 | 425.555.0100 12 |
13 | 14 |
15 | Support: Support@example.com
16 | Marketing: Marketing@example.com 17 |
18 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/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 | Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. 22 |

23 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/Views/Shared/_ValidationScriptsPartial.cshtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 12 | 18 | 19 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/Views/_ViewImports.cshtml: -------------------------------------------------------------------------------- 1 | @using WebApp 2 | @using WebApp.Models 3 | @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers 4 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/Views/_ViewStart.cshtml: -------------------------------------------------------------------------------- 1 | @{ 2 | Layout = "_Layout"; 3 | } 4 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/WebApp.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 15 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Debug", 6 | "System": "Information", 7 | "Microsoft": "Information" 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "IncludeScopes": false, 4 | "LogLevel": { 5 | "Default": "Warning" 6 | } 7 | }, 8 | 9 | "ConnectionStrings": { 10 | "SamuraiConnection": "Server=(localdb)\\mssqllocaldb;Database=SamuraiAppDataCore;Trusted_Connection=True;MultipleActiveResultSets=true" 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/bundleconfig.json: -------------------------------------------------------------------------------- 1 | // Configure bundling and minification for the project. 2 | // More info at https://go.microsoft.com/fwlink/?LinkId=808241 3 | [ 4 | { 5 | "outputFileName": "wwwroot/css/site.min.css", 6 | // An array of relative input file paths. Globbing patterns supported 7 | "inputFiles": [ 8 | "wwwroot/css/site.css" 9 | ] 10 | }, 11 | { 12 | "outputFileName": "wwwroot/js/site.min.js", 13 | "inputFiles": [ 14 | "wwwroot/js/site.js" 15 | ], 16 | // Optionally specify minification options 17 | "minify": { 18 | "enabled": true, 19 | "renameLocals": true 20 | }, 21 | // Optionally generate .map file 22 | "sourceMap": false 23 | } 24 | ] 25 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/css/site.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 50px; 3 | padding-bottom: 20px; 4 | } 5 | 6 | /* Wrapping element */ 7 | /* Set some basic padding to keep content from hitting the edges */ 8 | .body-content { 9 | padding-left: 15px; 10 | padding-right: 15px; 11 | } 12 | 13 | /* Carousel */ 14 | .carousel-caption p { 15 | font-size: 20px; 16 | line-height: 1.4; 17 | } 18 | 19 | /* Make .svg files in the carousel display properly in older browsers */ 20 | .carousel-inner .item img[src$=".svg"] { 21 | width: 100%; 22 | } 23 | 24 | /* QR code generator */ 25 | #qrCode { 26 | margin: 15px; 27 | } 28 | 29 | /* Hide/rearrange for smaller screens */ 30 | @media screen and (max-width: 767px) { 31 | /* Hide captions */ 32 | .carousel-caption { 33 | display: none; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/css/site.min.css: -------------------------------------------------------------------------------- 1 | body{padding-top:50px;padding-bottom:20px}.body-content{padding-left:15px;padding-right:15px}.carousel-caption p{font-size:20px;line-height:1.4}.carousel-inner .item img[src$=".svg"]{width:100%}#qrCode{margin:15px}@media screen and (max-width:767px){.carousel-caption{display:none}} -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/favicon.ico -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/js/site.js: -------------------------------------------------------------------------------- 1 | // Write your JavaScript code. 2 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/js/site.min.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/js/site.min.js -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "bootstrap", 3 | "description": "The most popular front-end framework for developing responsive, mobile first projects on the web.", 4 | "keywords": [ 5 | "css", 6 | "js", 7 | "less", 8 | "mobile-first", 9 | "responsive", 10 | "front-end", 11 | "framework", 12 | "web" 13 | ], 14 | "homepage": "http://getbootstrap.com", 15 | "license": "MIT", 16 | "moduleType": "globals", 17 | "main": [ 18 | "less/bootstrap.less", 19 | "dist/js/bootstrap.js" 20 | ], 21 | "ignore": [ 22 | "/.*", 23 | "_config.yml", 24 | "CNAME", 25 | "composer.json", 26 | "CONTRIBUTING.md", 27 | "docs", 28 | "js/tests", 29 | "test-infra" 30 | ], 31 | "dependencies": { 32 | "jquery": "1.9.1 - 3" 33 | }, 34 | "version": "3.3.7", 35 | "_release": "3.3.7", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.3.7", 39 | "commit": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" 40 | }, 41 | "_source": "https://github.com/twbs/bootstrap.git", 42 | "_target": "v3.3.7", 43 | "_originalSource": "bootstrap", 44 | "_direct": true 45 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2011-2016 Twitter, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/julielerman/PluralsightEFCore2GettingStarted/9c36203183e81912ca1f9279be9ab5ffac8e7ff9/M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/bootstrap/dist/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/jquery-validation-unobtrusive/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation-unobtrusive", 3 | "version": "3.2.6", 4 | "homepage": "https://github.com/aspnet/jquery-validation-unobtrusive", 5 | "description": "Add-on to jQuery Validation to enable unobtrusive validation options in data-* attributes.", 6 | "main": [ 7 | "jquery.validate.unobtrusive.js" 8 | ], 9 | "ignore": [ 10 | "**/.*", 11 | "*.json", 12 | "*.md", 13 | "*.txt", 14 | "gulpfile.js" 15 | ], 16 | "keywords": [ 17 | "jquery", 18 | "asp.net", 19 | "mvc", 20 | "validation", 21 | "unobtrusive" 22 | ], 23 | "authors": [ 24 | "Microsoft" 25 | ], 26 | "license": "http://www.microsoft.com/web/webpi/eula/net_library_eula_enu.htm", 27 | "repository": { 28 | "type": "git", 29 | "url": "git://github.com/aspnet/jquery-validation-unobtrusive.git" 30 | }, 31 | "dependencies": { 32 | "jquery-validation": ">=1.8", 33 | "jquery": ">=1.8" 34 | }, 35 | "_release": "3.2.6", 36 | "_resolution": { 37 | "type": "version", 38 | "tag": "v3.2.6", 39 | "commit": "13386cd1b5947d8a5d23a12b531ce3960be1eba7" 40 | }, 41 | "_source": "git://github.com/aspnet/jquery-validation-unobtrusive.git", 42 | "_target": "3.2.6", 43 | "_originalSource": "jquery-validation-unobtrusive" 44 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/jquery-validation/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery-validation", 3 | "homepage": "http://jqueryvalidation.org/", 4 | "repository": { 5 | "type": "git", 6 | "url": "git://github.com/jzaefferer/jquery-validation.git" 7 | }, 8 | "authors": [ 9 | "Jörn Zaefferer " 10 | ], 11 | "description": "Form validation made easy", 12 | "main": "dist/jquery.validate.js", 13 | "keywords": [ 14 | "forms", 15 | "validation", 16 | "validate" 17 | ], 18 | "license": "MIT", 19 | "ignore": [ 20 | "**/.*", 21 | "node_modules", 22 | "bower_components", 23 | "test", 24 | "demo", 25 | "lib" 26 | ], 27 | "dependencies": { 28 | "jquery": ">= 1.7.2" 29 | }, 30 | "version": "1.14.0", 31 | "_release": "1.14.0", 32 | "_resolution": { 33 | "type": "version", 34 | "tag": "1.14.0", 35 | "commit": "c1343fb9823392aa9acbe1c3ffd337b8c92fed48" 36 | }, 37 | "_source": "git://github.com/jzaefferer/jquery-validation.git", 38 | "_target": ">=1.8", 39 | "_originalSource": "jquery-validation" 40 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/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 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/jquery/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "jquery", 3 | "main": "dist/jquery.js", 4 | "license": "MIT", 5 | "ignore": [ 6 | "package.json" 7 | ], 8 | "keywords": [ 9 | "jquery", 10 | "javascript", 11 | "browser", 12 | "library" 13 | ], 14 | "homepage": "https://github.com/jquery/jquery-dist", 15 | "version": "2.2.0", 16 | "_release": "2.2.0", 17 | "_resolution": { 18 | "type": "version", 19 | "tag": "2.2.0", 20 | "commit": "6fc01e29bdad0964f62ef56d01297039cdcadbe5" 21 | }, 22 | "_source": "git://github.com/jquery/jquery-dist.git", 23 | "_target": "2.2.0", 24 | "_originalSource": "jquery" 25 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiCoreApp Web/WebApp/wwwroot/lib/jquery/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 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 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Data/ConnectedData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using Microsoft.EntityFrameworkCore; 5 | using Microsoft.EntityFrameworkCore.ChangeTracking; 6 | using SamuraiApp.Domain; 7 | 8 | namespace SamuraiApp.Data 9 | { 10 | 11 | public class ConnectedData 12 | { 13 | private SamuraiContext _context; 14 | 15 | public ConnectedData() 16 | { 17 | _context = new SamuraiContext(); 18 | _context.Database.EnsureCreated(); 19 | } 20 | 21 | public Samurai CreateNewSamurai() 22 | { 23 | var samurai = new Samurai { Name = "New Samurai" }; 24 | _context.Samurais.Add(samurai); 25 | return samurai; 26 | } 27 | 28 | public LocalView SamuraisListInMemory() 29 | { 30 | if (_context.Samurais.Local.Count == 0) 31 | { 32 | _context.Samurais.ToList(); 33 | } 34 | return _context.Samurais.Local; 35 | } 36 | 37 | public Samurai LoadSamuraiGraph(int samuraiId) 38 | { 39 | var samurai = _context.Samurais.Find(samuraiId); //gets from tracker if its there 40 | _context.Entry(samurai).Reference(s => s.SecretIdentity).Load(); 41 | _context.Entry(samurai).Collection(s => s.Quotes).Load(); 42 | 43 | return samurai; 44 | } 45 | 46 | public void SaveChanges(Type typeBeingEdited) 47 | { 48 | _context.SaveChanges(); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Data/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("SamuraiApp.Data")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Data")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("72d65b38-7cae-40c6-8ba2-d5e240d0e042")] 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 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Data/app.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Domain/Battle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class Battle 7 | { 8 | public int Id { get; set; } 9 | public string Name { get; set; } 10 | public DateTime StartDate { get; set; } 11 | public DateTime EndDate { get; set; } 12 | public List SamuraiBattles { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Domain/InMemoryChangeTracker.cs: -------------------------------------------------------------------------------- 1 | using System.ComponentModel; 2 | using System.Runtime.CompilerServices; 3 | 4 | namespace SamuraiApp.Domain 5 | { 6 | public class ClientChangeTracker : INotifyPropertyChanged 7 | { 8 | private bool _isDirty; 9 | 10 | public bool IsDirty 11 | { 12 | get { return _isDirty; } 13 | set { SetWithNotify(value, ref _isDirty); } 14 | } 15 | 16 | public event PropertyChangedEventHandler PropertyChanged; 17 | protected void SetWithNotify 18 | (T value, ref T field, [CallerMemberName] string propertyName = "") 19 | { 20 | if (!Equals(field, value)) 21 | { 22 | field = value; 23 | PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Domain/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("SamuraiApp.Domain")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SamuraiApp.Domain")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 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("15474cfa-9e4d-4ca6-9a4e-3cab6f17d676")] 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 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Domain/Quote.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class Quote 4 | { 5 | public int Id { get; set; } 6 | public string Text { get; set; } 7 | public Samurai Samurai { get; set; } 8 | public int SamuraiId { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Domain/Samurai.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | 3 | namespace SamuraiApp.Domain 4 | { 5 | public class Samurai 6 | { 7 | public Samurai() 8 | { 9 | Quotes = new List(); 10 | } 11 | public int Id { get; set; } 12 | public string Name { get; set; } 13 | public List Quotes { get; set; } 14 | //public int BattleId { get; set; } 15 | public List SamuraiBattles { get; set; } 16 | public SecretIdentity SecretIdentity { get; set; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Domain/SamuraiBattle.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SamuraiBattle 4 | { 5 | public int SamuraiId { get; set; } 6 | public Samurai Samurai { get; set; } 7 | public int BattleId { get; set; } 8 | public Battle Battle { get; set; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiApp.Domain/SecretIdentity.cs: -------------------------------------------------------------------------------- 1 | namespace SamuraiApp.Domain 2 | { 3 | public class SecretIdentity 4 | { 5 | public int Id { get; set; } 6 | public string RealName { get; set; } 7 | public int SamuraiId { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /M5Downloads (Using in Apps...)/Before/SamuraiWpfApp/SamuraiWpfApp.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27130.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiApp.Domain", "SamuraiApp.Domain\SamuraiApp.Domain.csproj", "{15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SamuraiApp.Data", "SamuraiApp.Data\SamuraiApp.Data.csproj", "{72D65B38-7CAE-40C6-8BA2-D5E240D0E042}" 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 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {15474CFA-9E4D-4CA6-9A4E-3CAB6F17D676}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {72D65B38-7CAE-40C6-8BA2-D5E240D0E042}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 21 | {72D65B38-7CAE-40C6-8BA2-D5E240D0E042}.Debug|Any CPU.Build.0 = Debug|Any CPU 22 | {72D65B38-7CAE-40C6-8BA2-D5E240D0E042}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {72D65B38-7CAE-40C6-8BA2-D5E240D0E042}.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 = {F16FED5C-6A7B-41F6-8BF4-58B791B0C26C} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Pluralsight Course: EF Core 2: GettingStarted 2 | ## I have updated all of the projects to use EF Core 2.2 3 | Sample code for my "EF Core 2: Getting Started" course released Feb 2018 4 | 5 | 6 | This is the source code for Pluralsight course EF Core 2: Getting Started. 7 | 8 | 9 | Most of these changes are just package ref changes in the csproj files. 10 | 11 | The only code changes I made are: 12 | 13 | * in the Module 3 After and Module 4 After, program.cs, where there is a new method to demonstrate a change to batching in EF COre starting with 2.1. The change that came to 2.1 is that by default, batching is only used when there are 4 or more commands to send to the database. 14 | * I have updated the logging syntax used in the DbContext files to reflect the simpler APIs that arrived in 2.2. You'll find this code in the BEFORE and AFTER solutions with comments to explain. For more detail on this change, I've written this blog post: http://thedatafarm.com/data-access/logging-in-ef-core-2-2-has-a-simpler-syntax-more-like-asp-net-core/. 15 | 16 | You can watch the course at: http://bit.ly/2oBvekc. 17 | 18 | If you don't have a subscription, send me a note and I can send you a code for a free 30-day trial. 19 | http://thedatafarm.com/contact/ 20 | --------------------------------------------------------------------------------