From 2d21dd5bb6552b940f5e5b3396a5396f064d6108 Mon Sep 17 00:00:00 2001 From: f7Q Date: Sat, 28 Oct 2017 11:41:44 +0900 Subject: [PATCH 1/2] console update --- console/global.json | 3 +-- console/src/src.csproj | 8 ++++---- ef/NuGet.config | 14 +++++++------- ef/src/Models/Company.cs | 22 +++++++++++----------- ef/src/Models/Employee.cs | 20 ++++++++++---------- 5 files changed, 33 insertions(+), 34 deletions(-) diff --git a/console/global.json b/console/global.json index d76e72f..5d5d3a7 100644 --- a/console/global.json +++ b/console/global.json @@ -1,6 +1,5 @@ { - "projects": [ "src" ], "sdk": { - "version": "1.1.0" + "version": "2.0.2" } } \ No newline at end of file diff --git a/console/src/src.csproj b/console/src/src.csproj index 698b553..ce86ae9 100644 --- a/console/src/src.csproj +++ b/console/src/src.csproj @@ -1,13 +1,13 @@  - netcoreapp1.1 + netcoreapp2.0 portable src Exe src $(PackageTargetFallback) - 1.1.2 + 2.0.0 @@ -15,8 +15,8 @@ win10-x64 - - + + diff --git a/ef/NuGet.config b/ef/NuGet.config index d2c31a0..7604d00 100644 --- a/ef/NuGet.config +++ b/ef/NuGet.config @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/ef/src/Models/Company.cs b/ef/src/Models/Company.cs index a4835c2..560faeb 100644 --- a/ef/src/Models/Company.cs +++ b/ef/src/Models/Company.cs @@ -1,12 +1,12 @@ -using System.Collections.Generic; - -namespace ef.Models -{ - public class Company - { - public int id { get; set; } - public string Name { get; set; } - public int Capital { get; set; } - public List Employees { get; set; } - } +using System.Collections.Generic; + +namespace ef.Models +{ + public class Company + { + public int id { get; set; } + public string Name { get; set; } + public int Capital { get; set; } + public List Employees { get; set; } + } } \ No newline at end of file diff --git a/ef/src/Models/Employee.cs b/ef/src/Models/Employee.cs index 2b416ed..c52e699 100644 --- a/ef/src/Models/Employee.cs +++ b/ef/src/Models/Employee.cs @@ -1,11 +1,11 @@ -using System.Collections.Generic; - -namespace ef.Models -{ - public class Employee - { - public int id { get; set; } - public string FirstName { get; set; } - public string LastName { get; set; } - } +using System.Collections.Generic; + +namespace ef.Models +{ + public class Employee + { + public int id { get; set; } + public string FirstName { get; set; } + public string LastName { get; set; } + } } \ No newline at end of file From f4db76778e67894b1c49537e1df393b98004eb02 Mon Sep 17 00:00:00 2001 From: f7Q Date: Sun, 29 Oct 2017 13:06:59 +0900 Subject: [PATCH 2/2] update dotnet core 2.0 --- PortableLib/global.json | 3 +- PortableLib/src/Sample/Sample.csproj | 8 +-- .../src/WpfApplication/WpfApplication.csproj | 5 ++ cakebuild/NuGet.config | 3 +- cakebuild/build.cake | 4 +- cakebuild/global.json | 3 +- cakebuild/src/Sample/Sample.csproj | 6 +-- .../test/Sample.Tests/Sample.Tests.csproj | 11 ++-- ef/global.json | 3 +- ef/src/Models/CoreExampleContext.cs | 4 +- ef/src/Program.cs | 5 +- ef/src/appsettings.json | 2 +- ef/src/src.csproj | 50 ++++++++----------- scaffold/global.json | 3 +- scaffold/src/scaffold.txt | 4 +- scaffold/src/src.csproj | 18 +++---- 16 files changed, 64 insertions(+), 68 deletions(-) diff --git a/PortableLib/global.json b/PortableLib/global.json index d76e72f..5d5d3a7 100644 --- a/PortableLib/global.json +++ b/PortableLib/global.json @@ -1,6 +1,5 @@ { - "projects": [ "src" ], "sdk": { - "version": "1.1.0" + "version": "2.0.2" } } \ No newline at end of file diff --git a/PortableLib/src/Sample/Sample.csproj b/PortableLib/src/Sample/Sample.csproj index a53f498..8ca81ca 100644 --- a/PortableLib/src/Sample/Sample.csproj +++ b/PortableLib/src/Sample/Sample.csproj @@ -1,13 +1,13 @@  - netstandard1.6;net461 + netstandard2.0;net461 portable true Sample Sample - $(PackageTargetFallback);dotnet5.6;dnxcore50;portable-net45+net461+win8 - 1.6.1 + $(PackageTargetFallback);dotnet5.6;dnxcore50;portable-net45+net461+win8 + 2.0.1 @@ -15,4 +15,6 @@ + + diff --git a/PortableLib/src/WpfApplication/WpfApplication.csproj b/PortableLib/src/WpfApplication/WpfApplication.csproj index 7b041c0..2e16089 100644 --- a/PortableLib/src/WpfApplication/WpfApplication.csproj +++ b/PortableLib/src/WpfApplication/WpfApplication.csproj @@ -131,6 +131,11 @@ Sample + + + 2.0.1 + + - + diff --git a/cakebuild/build.cake b/cakebuild/build.cake index fa87363..82480ee 100644 --- a/cakebuild/build.cake +++ b/cakebuild/build.cake @@ -9,8 +9,8 @@ var buildArtifacts = Directory("./artifacts/packages"); var isAppVeyor = AppVeyor.IsRunningOnAppVeyor; var isWindows = IsRunningOnWindows(); -var netcore = "netcoreapp1.1"; -var netstandard = "netstandard1.6"; +var netcore = "netcoreapp2.0"; +var netstandard = "netstandard2.0"; /////////////////////////////////////////////////////////////////////////////// // Clean diff --git a/cakebuild/global.json b/cakebuild/global.json index 194114a..5d5d3a7 100644 --- a/cakebuild/global.json +++ b/cakebuild/global.json @@ -1,6 +1,5 @@ { - "projects": [ "src", "test" ], "sdk": { - "version": "1.1.0" + "version": "2.0.2" } } \ No newline at end of file diff --git a/cakebuild/src/Sample/Sample.csproj b/cakebuild/src/Sample/Sample.csproj index 7ca0712..c8188ed 100644 --- a/cakebuild/src/Sample/Sample.csproj +++ b/cakebuild/src/Sample/Sample.csproj @@ -1,13 +1,13 @@  - netcoreapp1.1 + netcoreapp2.0 portable true Sample Sample - 1.1.2 - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 + 2.0.0 + $(PackageTargetFallback) diff --git a/cakebuild/test/Sample.Tests/Sample.Tests.csproj b/cakebuild/test/Sample.Tests/Sample.Tests.csproj index 36e9ee3..8dfac07 100644 --- a/cakebuild/test/Sample.Tests/Sample.Tests.csproj +++ b/cakebuild/test/Sample.Tests/Sample.Tests.csproj @@ -1,13 +1,14 @@ - netcoreapp1.1 + netcoreapp2.0 portable Sample.Tests Sample.Tests true - $(PackageTargetFallback);dotnet5.4;portable-net451+win8 - 1.1.2 + $(PackageTargetFallback) + 2.0.0 + false @@ -15,10 +16,10 @@ - + - + diff --git a/ef/global.json b/ef/global.json index d76e72f..5d5d3a7 100644 --- a/ef/global.json +++ b/ef/global.json @@ -1,6 +1,5 @@ { - "projects": [ "src" ], "sdk": { - "version": "1.1.0" + "version": "2.0.2" } } \ No newline at end of file diff --git a/ef/src/Models/CoreExampleContext.cs b/ef/src/Models/CoreExampleContext.cs index 7d1965a..120fe48 100644 --- a/ef/src/Models/CoreExampleContext.cs +++ b/ef/src/Models/CoreExampleContext.cs @@ -4,6 +4,8 @@ namespace ef.Models { + using System; + public class CoreExampleContext : DbContext { public DbSet Company { get; set; } @@ -42,7 +44,7 @@ protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) } if (dbkind.Equals("inmemory")) { - optionsBuilder.UseInMemoryDatabase(); + optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString()); } } } diff --git a/ef/src/Program.cs b/ef/src/Program.cs index 9a24c13..73f9faa 100644 --- a/ef/src/Program.cs +++ b/ef/src/Program.cs @@ -15,6 +15,7 @@ namespace ef { public class Program { + /* private static DbContextOptions CreateNewContextOptions() { var serviceProvider = new ServiceCollection() @@ -27,6 +28,8 @@ private static DbContextOptions CreateNewContextOptions() return builder.Options; } + */ + private static IConfigurationRoot Configuration { get; set; } private static IHostingEnvironment HostingEnvironment { get; set; } @@ -73,7 +76,7 @@ public static void Main(string[] args) service.AddEntityFrameworkInMemoryDatabase(); service.AddDbContext(options => { - options.UseInMemoryDatabase(); + options.UseInMemoryDatabase(Guid.NewGuid().ToString()); }); } diff --git a/ef/src/appsettings.json b/ef/src/appsettings.json index 8114dea..5ab31b1 100644 --- a/ef/src/appsettings.json +++ b/ef/src/appsettings.json @@ -2,7 +2,7 @@ "Data": { "DefaultConnection": { "ConnectionDBString": "sqlite", - "ConnectionString": "Data Source=..\\..\\..\\db.sqlite" + "ConnectionString": "Data Source=db.sqlite" } /* "DefaultConnection": { diff --git a/ef/src/src.csproj b/ef/src/src.csproj index ee1b30a..3b5f704 100644 --- a/ef/src/src.csproj +++ b/ef/src/src.csproj @@ -1,46 +1,36 @@  - netcoreapp1.1 + netcoreapp2.0 portable src Exe src - $(PackageTargetFallback);dotnet5.6;portable-net45+win8 - win10-x64;osx.10.11-x64;ubuntu.16.04-x64 - 1.1.2 + $(PackageTargetFallback); + win7-x86;win10-x64;osx.10.11-x64;ubuntu.16.04-x64 + 2.0.0 - - All - - - - - - All - - - All - - - All - - - All - - - - - - - - + + + + + + + + + + + + + + + - + diff --git a/scaffold/global.json b/scaffold/global.json index d76e72f..5d5d3a7 100644 --- a/scaffold/global.json +++ b/scaffold/global.json @@ -1,6 +1,5 @@ { - "projects": [ "src" ], "sdk": { - "version": "1.1.0" + "version": "2.0.2" } } \ No newline at end of file diff --git a/scaffold/src/scaffold.txt b/scaffold/src/scaffold.txt index 0030243..20ccac5 100644 --- a/scaffold/src/scaffold.txt +++ b/scaffold/src/scaffold.txt @@ -1 +1,3 @@ -dotnet ef dbcontext scaffold "Data Source=..\..\..\db.sqlite" Microsoft.EntityFrameworkCore.Sqlite -o Models \ No newline at end of file +dotnet ef dbcontext scaffold "Data Source=db.sqlite" Microsoft.EntityFrameworkCore.Sqlite -o Models +dotnet ef dbcontext scaffold "Data Source=db.sqlite" Microsoft.EntityFrameworkCore.Sqlite -o Models -t Company +dotnet ef dbcontext scaffold "Data Source=db.sqlite" Microsoft.EntityFrameworkCore.Sqlite -o Models -c AbcDbContext \ No newline at end of file diff --git a/scaffold/src/src.csproj b/scaffold/src/src.csproj index 2638cc6..8a65e83 100644 --- a/scaffold/src/src.csproj +++ b/scaffold/src/src.csproj @@ -1,29 +1,25 @@  - netcoreapp1.1 + netcoreapp2.0 portable true src Exe src true - 1.1.2 - $(PackageTargetFallback);dotnet5.6;dnxcore50;portable-net45+win8 + 2.0.0 + $(PackageTargetFallback); - - - All - - - All - + + + - +