Skip to content

Commit

Permalink
Migrate tests and examples to .NET Core 3.1 (LTS)
Browse files Browse the repository at this point in the history
  • Loading branch information
VitaliyMF committed May 26, 2020
1 parent b0e3be2 commit dba9198
Show file tree
Hide file tree
Showing 25 changed files with 94 additions and 244 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
@@ -1,7 +1,7 @@
language: csharp
sudo: required
dist: trusty
dotnet: 2.1.300
dist: xenial
dotnet: 3.1
solution: src/NReco.Data.sln

script:
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
@@ -1,5 +1,5 @@
version: 1.0.{build}
os: Visual Studio 2017
os: Visual Studio 2019
configuration: Release
platform: Any CPU

Expand Down
Expand Up @@ -2,13 +2,13 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageReference Include="NReco.Data" Version="1.0.6" />
<PackageReference Include="MySqlConnector" Version="0.52.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.4" />
<PackageReference Include="NReco.Data" Version="1.1.1" />
<PackageReference Include="MySqlConnector" Version="0.66.0" />
</ItemGroup>


Expand Down

This file was deleted.

10 changes: 3 additions & 7 deletions examples/MySqlDemo.DbMetadata/MySqlDemo.DbMetadata.csproj
@@ -1,18 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>MySqlDemo.DbMetadata</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>MySqlDemo.DbMetadata</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MySqlConnector" Version="0.52.0" />
<PackageReference Include="NReco.Data" Version="1.0.6" />
<PackageReference Include="MySqlConnector" Version="0.66.0" />
<PackageReference Include="NReco.Data" Version="1.1.1" />
<PackageReference Include="System.Data.SqlClient" Version="4.5.0" />
</ItemGroup>

Expand Down
19 changes: 0 additions & 19 deletions examples/MySqlDemo.DbMetadata/Properties/AssemblyInfo.cs

This file was deleted.

19 changes: 0 additions & 19 deletions examples/SqliteDemo.CommandBuilder/Properties/AssemblyInfo.cs

This file was deleted.

This file was deleted.

@@ -1,18 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>SqliteDemo.CommandBuilder</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>SqliteDemo.CommandBuilder</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NReco.Data" Version="1.0.6" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageReference Include="NReco.Data" Version="1.1.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.4" />
</ItemGroup>

<ItemGroup>
Expand Down
19 changes: 0 additions & 19 deletions examples/SqliteDemo.DataAdapter/Properties/AssemblyInfo.cs

This file was deleted.

This file was deleted.

10 changes: 3 additions & 7 deletions examples/SqliteDemo.DataAdapter/SqliteDemo.DataAdapter.csproj
@@ -1,19 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>SqliteDemo.DataAdapter</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>SqliteDemo.DataAdapter</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.4" />
<PackageReference Include="System.ComponentModel.Annotations" Version="4.5.0" />
<PackageReference Include="NReco.Data" Version="1.0.6" />
<PackageReference Include="NReco.Data" Version="1.1.1" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions examples/SqliteDemo.GraphQLApi/Program.cs
Expand Up @@ -8,6 +8,9 @@

namespace SqliteDemo.GraphQLApi
{
// Simple grapql API based on Graphql.NET + NReco.Data
// If you're looking for production-ready Graphql-to-SQL engine try this component:
// https://www.nrecosite.com/graphql_to_sql_database.aspx
public class Program
{
public static void Main(string[] args)
Expand All @@ -16,6 +19,7 @@ public static void Main(string[] args)
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseIIS()
.UseStartup<Startup>()
.Build();

Expand Down
31 changes: 5 additions & 26 deletions examples/SqliteDemo.GraphQLApi/SqliteDemo.GraphQLAPI.csproj
@@ -1,34 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>SqliteDemo.GraphQLAPI</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>SqliteDemo.GraphQLAPI</PackageId>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<None Update="wwwroot\**\*;Views;Areas\**\Views;northwind.db">
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
</None>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.1.7" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.1.3" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.1.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageReference Include="NReco.Data" Version="1.0.6" />
<PackageReference Include="GraphQL" Version="2.4.0" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.4" />
<PackageReference Include="NReco.Data" Version="1.1.1" />
<PackageReference Include="GraphQL" Version="2.4.0" />
</ItemGroup>

<ItemGroup>
Expand Down
28 changes: 19 additions & 9 deletions examples/SqliteDemo.GraphQLApi/Startup.cs
Expand Up @@ -18,11 +18,15 @@
using SqliteDemo.GraphQLApi.Db.GraphQL;

namespace SqliteDemo.GraphQLApi {

// Simple grapql API based on Graphql.NET + NReco.Data
// If you're looking for production-ready Graphql-to-SQL engine try this component:
// https://www.nrecosite.com/graphql_to_sql_database.aspx
public class Startup {
const string dbConnectionFile = "northwind.db";
protected string ApplicationPath;

public Startup(IHostingEnvironment env) {
public Startup(IWebHostEnvironment env) {
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true)
Expand All @@ -39,13 +43,22 @@ public class Startup {

// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services) {
// let's inject NReco.Data services (based on EF DBConnection)
services.AddLogging(loggingBuilder => {
var loggingSection = Configuration.GetSection("Logging");
loggingBuilder.AddConfiguration(loggingSection);
loggingBuilder.AddConsole();
});

// NReco.Data services
InjectNRecoDataService(services);
//

InjectGraphQLSchema(services);
services.AddScoped<IDatabaseMetadata, DatabaseMetadata>();

// Add framework services.
services.AddMvc();
services.AddMvc(options => {
options.EnableEndpointRouting = false;
});
}

protected void InjectGraphQLSchema(IServiceCollection services) {
Expand Down Expand Up @@ -84,11 +97,8 @@ public class Startup {
}

// This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
loggerFactory.AddConsole(Configuration.GetSection("Logging"));
loggerFactory.AddDebug();
//app.UseDeveloperExceptionPage();
//app.UseBrowserLink();
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) {

app.UseDefaultFiles();
app.UseStaticFiles();

Expand Down
2 changes: 2 additions & 0 deletions examples/SqliteDemo.MVCApplication/Program.cs
Expand Up @@ -7,6 +7,7 @@

namespace SqliteDemo.MVCApplication
{
// CRUD app that uses both EF Core AND NReco.Data
public class Program
{
public static void Main(string[] args)
Expand All @@ -15,6 +16,7 @@ public static void Main(string[] args)
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseIIS()
.UseStartup<Startup>()
.Build();

Expand Down
@@ -1,11 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>SqliteDemo.MVCApplication</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>SqliteDemo.MVCApplication</PackageId>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,29 +11,15 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="2.2.4">
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="3.1.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.4">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.1.1" />

<PackageReference Include="Microsoft.AspNetCore.Mvc" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.2.0" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="3.1.4" />


<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="2.2.4" />

<PackageReference Include="NReco.Data" Version="1.0.6" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="2.2.4" />
<PackageReference Include="NReco.Data" Version="1.1.1" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="3.1.4" />
</ItemGroup>

<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
Expand Down

0 comments on commit dba9198

Please sign in to comment.