Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dotnet9 migration #516

Merged
merged 10 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
dotnet-version: '9.x'
- name: Install dependencies
working-directory: src
run: dotnet restore
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: '7.x'
dotnet-version: '9.x'
- name: Install dependencies
working-directory: src
run: dotnet restore
Expand Down
12 changes: 6 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files.exclude": {
"src": true, // this is a default value
"documentation": true, // this is a default value
"docs": true, // this is a default value
},
{
"files.exclude": {
"src": false,
"documentation": true, // this is a default value
"docs": true, // this is a default value
},
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ using Paillave.Etl.FileSystem;
using Paillave.Etl.Zip;
using Paillave.Etl.TextFile;
using Paillave.Etl.SqlServer;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Linq;

namespace SimpleTutorial
Expand Down Expand Up @@ -141,7 +141,7 @@ using Paillave.Etl.FileSystem;
using Paillave.Etl.Zip;
using Paillave.Etl.TextFile;
using Paillave.Etl.SqlServer;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace SimpleTutorial
{
Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/tutorials/2-defineProcess.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ contextStream

## Setup the connection

By using `System.Data.SqlClient`, we create a connection to the database and we will inject it into the ETL process when triggering it.
By using `Microsoft.Data.SqlClient`, we create a connection to the database and we will inject it into the ETL process when triggering it.

The extension that needs to operate with the database will get its connection through the DI setup here.

Expand Down Expand Up @@ -200,7 +200,7 @@ using Paillave.Etl.FileSystem;
using Paillave.Etl.Zip;
using Paillave.Etl.TextFile;
using Paillave.Etl.SqlServer;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using Paillave.Etl.Core;

namespace SimpleTutorial
Expand Down
2 changes: 1 addition & 1 deletion documentation/docs/tutorials/3-trackAndCheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ using Paillave.Etl.FileSystem;
using Paillave.Etl.Zip;
using Paillave.Etl.TextFile;
using Paillave.Etl.SqlServer;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace SimpleTutorial
{
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/components/HomepageExamples.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ using Paillave.Etl.FileSystem;
using Paillave.Etl.Zip;
using Paillave.Etl.TextFile;
using Paillave.Etl.SqlServer;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;

namespace SimpleTutorial
{
Expand Down
2 changes: 1 addition & 1 deletion documentation/src/components/QuickStart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using Paillave.Etl.FileSystem;
using Paillave.Etl.Zip;
using Paillave.Etl.TextFile;
using Paillave.Etl.SqlServer;
using System.Data.SqlClient;
using Microsoft.Data.SqlClient;
using System.Linq;

namespace SimpleTutorial
Expand Down
10 changes: 5 additions & 5 deletions src/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Paillave.Etl.Scheduler/bin/Debug/net7.0/Paillave.Etl.Scheduler.dll",
"program": "${workspaceFolder}/Paillave.Etl.Scheduler/bin/Debug/net9.0/Paillave.Etl.Scheduler.dll",
"args": [ ],
"cwd": "${workspaceFolder}/Paillave.Etl.Scheduler",
"stopAtEntry": false,
Expand All @@ -20,7 +20,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Tutorials/Paillave.Etl.Samples/bin/Debug/net7.0/Paillave.Etl.Samples.dll",
"program": "${workspaceFolder}/Tutorials/Paillave.Etl.Samples/bin/Debug/net9.0/Paillave.Etl.Samples.dll",
"args": [
"/home/stephane/Desktop/"
],
Expand All @@ -33,7 +33,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Tutorials/SimpleTutorial/bin/Debug/net7.0/SimpleTutorial.dll",
"program": "${workspaceFolder}/Tutorials/SimpleTutorial/bin/Debug/net9.0/SimpleTutorial.dll",
"args": [
"data",
"Server=localhost,1433;Database=SimpleTutorial;user=SimpleTutorial;password=TestEtl.TestEtl;MultipleActiveResultSets=True"
Expand All @@ -47,7 +47,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Tutorials/BlogTutorial/bin/Debug/net7.0/BlogTutorial.dll",
"program": "${workspaceFolder}/Tutorials/BlogTutorial/bin/Debug/net9.0/BlogTutorial.dll",
"args": [
"data",
"Server=localhost,1433;Database=BlogTutorial;user=BlogTutorial;password=TestEtl.TestEtl;MultipleActiveResultSets=True"
Expand All @@ -61,7 +61,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/Tutorials/Paillave.Etl.Samples/bin/Debug/net7.0/Paillave.Etl.Samples.dll",
"program": "${workspaceFolder}/Tutorials/Paillave.Etl.Samples/bin/Debug/net9.0/Paillave.Etl.Samples.dll",
"args": [
"data",
"Server=localhost,1433;Database=BlogTutorial;user=BlogTutorial;password=TestEtl.TestEtl;MultipleActiveResultSets=True"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text;
using System.Threading;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
// using Paillave.EntityFrameworkCoreExtension.BulkSave.Postgres;
using Paillave.EntityFrameworkCoreExtension.BulkSave.SqlServer;

namespace Paillave.EntityFrameworkCoreExtension.BulkSave
namespace Paillave.EntityFrameworkCoreExtension.BulkSave;

public class BulkSaveEngine<T> : BulkSaveEngineBase<T> where T : class
{
public class BulkSaveEngine<T> : BulkSaveEngineBase<T> where T : class
public BulkSaveEngine(DbContext context, params Expression<Func<T, object>>[] pivotKeys) : base(context, pivotKeys)
{
public BulkSaveEngine(DbContext context, params Expression<Func<T, object>>[] pivotKeys) : base(context, pivotKeys)
{
}
}

protected override SaveContextQueryBase<T> CreateSaveContextQueryInstance(DbContext context, string schema, string table, List<IProperty> propertiesToInsert, List<IProperty> propertiesToUpdate, List<List<IProperty>> propertiesForPivotSet, List<IProperty> propertiesToBulkLoad, List<IEntityType> entityTypes, CancellationToken cancellationToken)
{
if (context.Database.IsSqlServer())
return new SqlServerSaveContextQuery<T>(context, schema, table, propertiesToInsert, propertiesToUpdate, propertiesForPivotSet, propertiesToBulkLoad, entityTypes, cancellationToken, base.StoreObject);
// if (context.Database.IsNpgsql())
// return new PostgresSaveContextQuery<T>(context, schema, table, propertiesToInsert, propertiesToUpdate, propertiesForPivotSet, propertiesToBulkLoad, entityTypes);
throw new Exception("unsupported provider");
}
protected override SaveContextQueryBase<T> CreateSaveContextQueryInstance(DbContext context, string schema, string table, List<IProperty> propertiesToInsert, List<IProperty> propertiesToUpdate, List<List<IProperty>> propertiesForPivotSet, List<IProperty> propertiesToBulkLoad, List<IEntityType> entityTypes, CancellationToken cancellationToken)
{
if (context.Database.IsSqlServer())
return new SqlServerSaveContextQuery<T>(context, schema, table, propertiesToInsert, propertiesToUpdate, propertiesForPivotSet, propertiesToBulkLoad, entityTypes, cancellationToken, base.StoreObject);
// if (context.Database.IsNpgsql())
// return new PostgresSaveContextQuery<T>(context, schema, table, propertiesToInsert, propertiesToUpdate, propertiesForPivotSet, propertiesToBulkLoad, entityTypes);
throw new Exception("unsupported provider");
}
}
Loading
Loading