-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from Nikoo-Asadnejad/develop
feat: add support of multiple dbcontext to unit of work
- Loading branch information
Showing
112 changed files
with
2,420 additions
and
185 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+162 KB
GenericRepository.Tests/bin/Debug/net8.0/EFCore.BulkExtensions.Core.dll
Binary file not shown.
Binary file added
BIN
+45 KB
GenericRepository.Tests/bin/Debug/net8.0/EFCore.BulkExtensions.MySql.dll
Binary file not shown.
Binary file added
BIN
+49.5 KB
GenericRepository.Tests/bin/Debug/net8.0/EFCore.BulkExtensions.PostgreSql.dll
Binary file not shown.
Binary file added
BIN
+42 KB
GenericRepository.Tests/bin/Debug/net8.0/EFCore.BulkExtensions.SqlServer.dll
Binary file not shown.
Binary file added
BIN
+39 KB
GenericRepository.Tests/bin/Debug/net8.0/EFCore.BulkExtensions.Sqlite.dll
Binary file not shown.
Binary file added
BIN
+18 KB
GenericRepository.Tests/bin/Debug/net8.0/EntityFramework.BulkExtensions.dll
Binary file not shown.
Binary file added
BIN
+38 KB
GenericRepository.Tests/bin/Debug/net8.0/EntityFramework.MappingAPI.dll
Binary file not shown.
Binary file added
BIN
+607 KB
GenericRepository.Tests/bin/Debug/net8.0/EntityFramework.SqlServer.dll
Binary file not shown.
Binary file not shown.
1,188 changes: 1,068 additions & 120 deletions
1,188
GenericRepository.Tests/bin/Debug/net8.0/GenericRepository.Tests.deps.json
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file modified
BIN
+0 Bytes
(100%)
GenericRepository.Tests/bin/Debug/net8.0/GenericRepository.Tests.dll
Binary file not shown.
Binary file modified
BIN
+2.53 KB
(120%)
GenericRepository.Tests/bin/Debug/net8.0/GenericRepository.Tests.pdb
Binary file not shown.
Binary file modified
BIN
+12 KB
(120%)
GenericRepository.Tests/bin/Debug/net8.0/GenericRepository.dll
Binary file not shown.
Binary file modified
BIN
+4.84 KB
(120%)
GenericRepository.Tests/bin/Debug/net8.0/GenericRepository.pdb
Binary file not shown.
Binary file added
BIN
+15.5 KB
GenericRepository.Tests/bin/Debug/net8.0/MedallionTopologicalSort.dll
Binary file not shown.
Binary file added
BIN
+14.4 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.Bcl.AsyncInterfaces.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+1.9 MB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.Relational.dll
Binary file not shown.
Binary file added
BIN
+19.5 KB
...epository.Tests/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.SqlServer.Abstractions.dll
Binary file not shown.
Binary file added
BIN
+95.5 KB
...Repository.Tests/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.SqlServer.HierarchyId.dll
Binary file not shown.
Binary file added
BIN
+536 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.SqlServer.dll
Binary file not shown.
Binary file added
BIN
+252 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.EntityFrameworkCore.Sqlite.dll
Binary file not shown.
Binary file added
BIN
+27.3 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.Extensions.Configuration.Abstractions.dll
Binary file not shown.
Binary file modified
BIN
+3.65 KB
(100%)
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.Extensions.DependencyModel.dll
Binary file not shown.
Binary file added
BIN
+65 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.Identity.Client.Extensions.Msal.dll
Binary file not shown.
Binary file added
BIN
+982 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.Identity.Client.dll
Binary file not shown.
Binary file added
BIN
+18.5 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.IdentityModel.Abstractions.dll
Binary file not shown.
Binary file added
BIN
+110 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.IdentityModel.JsonWebTokens.dll
Binary file not shown.
Binary file added
BIN
+35.9 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.IdentityModel.Logging.dll
Binary file not shown.
Binary file added
BIN
+111 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.IdentityModel.Protocols.OpenIdConnect.dll
Binary file not shown.
Binary file added
BIN
+38.9 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.IdentityModel.Protocols.dll
Binary file not shown.
Binary file added
BIN
+970 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.IdentityModel.Tokens.dll
Binary file not shown.
Binary file added
BIN
+23.4 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.SqlServer.Server.dll
Binary file not shown.
Binary file added
BIN
+350 KB
GenericRepository.Tests/bin/Debug/net8.0/Microsoft.SqlServer.Types.dll
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+26.5 KB
GenericRepository.Tests/bin/Debug/net8.0/NetTopologySuite.IO.SpatiaLite.dll
Binary file not shown.
Binary file added
BIN
+22.5 KB
GenericRepository.Tests/bin/Debug/net8.0/NetTopologySuite.IO.SqlServerBytes.dll
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+608 KB
GenericRepository.Tests/bin/Debug/net8.0/Npgsql.EntityFrameworkCore.PostgreSQL.dll
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+494 KB
GenericRepository.Tests/bin/Debug/net8.0/Pomelo.EntityFrameworkCore.MySql.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+432 KB
GenericRepository.Tests/bin/Debug/net8.0/System.Configuration.ConfigurationManager.dll
Binary file not shown.
Binary file modified
BIN
+544 Bytes
(100%)
GenericRepository.Tests/bin/Debug/net8.0/System.Diagnostics.EventLog.dll
Binary file not shown.
Binary file added
BIN
+75.5 KB
GenericRepository.Tests/bin/Debug/net8.0/System.IdentityModel.Tokens.Jwt.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+35.8 KB
GenericRepository.Tests/bin/Debug/net8.0/System.Security.Cryptography.ProtectedData.dll
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+264 KB
GenericRepository.Tests/bin/Debug/net8.0/de/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+31.9 KB
GenericRepository.Tests/bin/Debug/net8.0/de/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+256 KB
GenericRepository.Tests/bin/Debug/net8.0/es/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+31.9 KB
GenericRepository.Tests/bin/Debug/net8.0/es/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+265 KB
GenericRepository.Tests/bin/Debug/net8.0/fr/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+32.4 KB
GenericRepository.Tests/bin/Debug/net8.0/fr/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+258 KB
GenericRepository.Tests/bin/Debug/net8.0/it/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+31.9 KB
GenericRepository.Tests/bin/Debug/net8.0/it/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+286 KB
GenericRepository.Tests/bin/Debug/net8.0/ja/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+33.9 KB
GenericRepository.Tests/bin/Debug/net8.0/ja/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+265 KB
GenericRepository.Tests/bin/Debug/net8.0/ko/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+31.9 KB
GenericRepository.Tests/bin/Debug/net8.0/ko/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+252 KB
GenericRepository.Tests/bin/Debug/net8.0/pt-BR/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+31.9 KB
GenericRepository.Tests/bin/Debug/net8.0/pt-BR/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+341 KB
GenericRepository.Tests/bin/Debug/net8.0/ru/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+40.9 KB
GenericRepository.Tests/bin/Debug/net8.0/ru/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+1.98 MB
...icRepository.Tests/bin/Debug/net8.0/runtimes/unix/lib/net8.0/Microsoft.Data.SqlClient.dll
Binary file not shown.
Binary file added
BIN
+370 KB
...epository.Tests/bin/Debug/net8.0/runtimes/win-arm/native/Microsoft.Data.SqlClient.SNI.dll
Binary file not shown.
Binary file added
BIN
+480 KB
...ository.Tests/bin/Debug/net8.0/runtimes/win-arm64/native/Microsoft.Data.SqlClient.SNI.dll
Binary file not shown.
Binary file added
BIN
+492 KB
...epository.Tests/bin/Debug/net8.0/runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.dll
Binary file not shown.
Binary file added
BIN
+666 KB
GenericRepository.Tests/bin/Debug/net8.0/runtimes/win-x64/native/SqlServerSpatial160.dll
Binary file not shown.
Binary file added
BIN
+402 KB
...epository.Tests/bin/Debug/net8.0/runtimes/win-x86/native/Microsoft.Data.SqlClient.SNI.dll
Binary file not shown.
Binary file added
BIN
+558 KB
GenericRepository.Tests/bin/Debug/net8.0/runtimes/win-x86/native/SqlServerSpatial160.dll
Binary file not shown.
Binary file removed
BIN
-129 KB
...Repository.Tests/bin/Debug/net8.0/runtimes/win/lib/net6.0/System.Diagnostics.EventLog.dll
Binary file not shown.
Binary file added
BIN
+2.03 MB
...ricRepository.Tests/bin/Debug/net8.0/runtimes/win/lib/net8.0/Microsoft.Data.SqlClient.dll
Binary file not shown.
Binary file renamed
BIN
+781 KB
.../System.Diagnostics.EventLog.Messages.dll → .../System.Diagnostics.EventLog.Messages.dll
Binary file not shown.
Binary file added
BIN
+168 KB
...Repository.Tests/bin/Debug/net8.0/runtimes/win/lib/net8.0/System.Diagnostics.EventLog.dll
Binary file not shown.
Binary file added
BIN
+90.8 KB
GenericRepository.Tests/bin/Debug/net8.0/runtimes/win/lib/net8.0/System.Runtime.Caching.dll
Binary file not shown.
Binary file added
BIN
+223 KB
GenericRepository.Tests/bin/Debug/net8.0/zh-Hans/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+29.4 KB
GenericRepository.Tests/bin/Debug/net8.0/zh-Hans/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
Binary file added
BIN
+227 KB
GenericRepository.Tests/bin/Debug/net8.0/zh-Hant/Microsoft.Data.SqlClient.resources.dll
Binary file not shown.
Binary file added
BIN
+29.4 KB
GenericRepository.Tests/bin/Debug/net8.0/zh-Hant/Microsoft.SqlServer.Types.resources.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
GenericRepository.Tests/obj/Debug/net8.0/GenericRepository.Tests.AssemblyInfoInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
393db6154241468ab21270c1ecf289861edb70a371b63523943b35762ba3dac9 | ||
e03e0ff31eebecae1a468731ba49cc50002228c90d766e56b23fdd38e08eb357 |
Binary file modified
BIN
+196 Bytes
(100%)
...cRepository.Tests/obj/Debug/net8.0/GenericRepository.Tests.csproj.AssemblyReference.cache
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
...cRepository.Tests/obj/Debug/net8.0/GenericRepository.Tests.csproj.CoreCompileInputs.cache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
fbad29cc9496a5b52fd17d71ee7daf8d9c0362c10b0b995dded4e897a8073448 | ||
734b295e73d8265cd842d926529953d6531840fb66ae83939a79be0317eb3361 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+0 Bytes
(100%)
GenericRepository.Tests/obj/Debug/net8.0/GenericRepository.Tests.dll
Binary file not shown.
Binary file modified
BIN
+2.53 KB
(120%)
GenericRepository.Tests/obj/Debug/net8.0/GenericRepository.Tests.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion
2
GenericRepository.Tests/obj/Debug/net8.0/GenericRepository.Tests.sourcelink.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"documents":{"/Users/macbook/Projects/Generic Repository/*":"https://raw.githubusercontent.com/Nikoo-Asadnejad/GenericRepository/dc89b2d70f09714087814b4ec5fc6c22a56a217f/*"}} | ||
{"documents":{"/Users/macbook/Projects/Generic Repository/*":"https://raw.githubusercontent.com/Nikoo-Asadnejad/GenericRepository/c9ea29c11a611e048379e66ed6ee97ac21e79fac/*"}} |
Binary file modified
BIN
+0 Bytes
(100%)
GenericRepository.Tests/obj/Debug/net8.0/ref/GenericRepository.Tests.dll
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
GenericRepository.Tests/obj/Debug/net8.0/refint/GenericRepository.Tests.dll
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
17274201315108780 | ||
17274215514174141 |
24 changes: 20 additions & 4 deletions
24
GenericRepository/Application/Interfaces/UnitOfWork/IUnitOfWork.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
using Microsoft.Data.SqlClient; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Storage; | ||
|
||
namespace GenericRepository.Application.Interfaces.UnitOfWork; | ||
|
||
public interface IUnitOfWork | ||
public interface IUnitOfWork<TContext> where TContext : DbContext | ||
{ | ||
Task<int> SaveAsync(); | ||
int Save(); | ||
Task DisposeAsync(); | ||
void Dispose(); | ||
Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default); | ||
Task RollbackTransactionAsync(); | ||
Task CommitTransactionAsync(); | ||
Task<IDbContextTransaction> BeginTransactionAsync(CancellationToken cancellationToken = default); | ||
IDbContextTransaction BeginTransaction(); | ||
Task RollbackTransactionAsync(CancellationToken cancellationToken = default); | ||
void RollbackTransaction(); | ||
Task CommitTransactionAsync(CancellationToken cancellationToken = default); | ||
void CommitTransaction(); | ||
Task<int> ExecuteSqlCommandAsync(string sql, object[] parameters, CancellationToken cancellationToken = default); | ||
int ExecuteSqlCommand(string sql, params object[] parameters); | ||
Task<List<T>> ExecuteSqlQueryAsync<T>(string sql, object[] parameters, CancellationToken cancellationToken = default) where T : class; | ||
List<T> ExecuteSqlQuery<T>(string sql, params object[] parameters) where T : class; | ||
Task ExecuteSqlWithinTransactionAsync(string sql, object[] parameters, CancellationToken cancellationToken = default); | ||
void ExecuteSqlWithinTransaction(string sql, params object[] parameters); | ||
Task<List<T>> ExecuteStoredProcedureAsync<T>(string storedProcedureName, object[] parameters, CancellationToken cancellationToken = default) where T : class; | ||
List<T> ExecuteStoredProcedure<T>(string storedProcedureName, params object[] parameters) where T : class; | ||
Task<int> ExecuteSqlCommandWithParamsAsync(string sql, SqlParameter[] parameters, CancellationToken cancellationToken = default); | ||
int ExecuteSqlCommandWithParams(string sql, params SqlParameter[] parameters); | ||
bool IsRawSqlSupported(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.