Skip to content

Commit

Permalink
Merge pull request #8 from Nikoo-Asadnejad/develop
Browse files Browse the repository at this point in the history
feat: add domain event and its interceptor
  • Loading branch information
Nikoo-Asadnejad authored Feb 25, 2024
2 parents ddbf592 + 6af2a27 commit 4b8d520
Show file tree
Hide file tree
Showing 62 changed files with 553 additions and 126 deletions.
2 changes: 1 addition & 1 deletion GenericRepository.Tests/MoqData/SampleModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GenericRepository.Entities;
using GenericRepository.Domain;

namespace GenericRepository.Tests.MoqData;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
using GenericRepository.Data;
using GenericRepository.Repository;
using GenericRepository.Tests.MoqData;
using Moq;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@
}
},
"coverlet.collector/3.1.2": {},
"MediatR/12.2.0": {
"dependencies": {
"MediatR.Contracts": "2.0.1",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
},
"runtime": {
"lib/net6.0/MediatR.dll": {
"assemblyVersion": "12.0.0.0",
"fileVersion": "12.2.0.0"
}
}
},
"MediatR.Contracts/2.0.1": {
"runtime": {
"lib/netstandard2.0/MediatR.Contracts.dll": {
"assemblyVersion": "2.0.1.0",
"fileVersion": "2.0.1.0"
}
}
},
"Microsoft.CodeCoverage/17.3.2": {
"runtime": {
"lib/netcoreapp1.0/Microsoft.VisualStudio.CodeCoverage.Shim.dll": {
Expand Down Expand Up @@ -98,7 +118,7 @@
"Microsoft.Extensions.Caching.Memory/7.0.0": {
"dependencies": {
"Microsoft.Extensions.Caching.Abstractions": "7.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.Logging.Abstractions": "7.0.0",
"Microsoft.Extensions.Options": "7.0.0",
"Microsoft.Extensions.Primitives": "7.0.0"
Expand All @@ -112,7 +132,7 @@
},
"Microsoft.Extensions.DependencyInjection/7.0.0": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0"
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
},
"runtime": {
"lib/net7.0/Microsoft.Extensions.DependencyInjection.dll": {
Expand All @@ -121,11 +141,11 @@
}
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions/7.0.0": {
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": {
"runtime": {
"lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
"assemblyVersion": "7.0.0.0",
"fileVersion": "7.0.22.51805"
"assemblyVersion": "8.0.0.0",
"fileVersion": "8.0.23.53103"
}
}
},
Expand All @@ -147,7 +167,7 @@
"Microsoft.Extensions.Logging/7.0.0": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection": "7.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.Logging.Abstractions": "7.0.0",
"Microsoft.Extensions.Options": "7.0.0"
},
Expand All @@ -168,7 +188,7 @@
},
"Microsoft.Extensions.Options/7.0.0": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.Primitives": "7.0.0"
},
"runtime": {
Expand Down Expand Up @@ -609,7 +629,7 @@
"runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {},
"Scrutor/4.2.0": {
"dependencies": {
"Microsoft.Extensions.DependencyInjection.Abstractions": "7.0.0",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0",
"Microsoft.Extensions.DependencyModel": "6.0.0"
},
"runtime": {
Expand Down Expand Up @@ -1293,6 +1313,7 @@
"xunit.runner.visualstudio/2.4.5": {},
"GenericRepository/1.0.0": {
"dependencies": {
"MediatR": "12.2.0",
"Microsoft.EntityFrameworkCore": "7.0.10",
"Microsoft.EntityFrameworkCore.Abstractions": "7.0.10",
"Scrutor": "4.2.0"
Expand Down Expand Up @@ -1323,6 +1344,20 @@
"path": "coverlet.collector/3.1.2",
"hashPath": "coverlet.collector.3.1.2.nupkg.sha512"
},
"MediatR/12.2.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-8TUFrHapKi6D74PhnSNEguRsH91HNGyP3R4ZQdgDorJgl9Wac5Prh0vA33QfrniAaS6L2xNNhc6vxzg+5AIbwA==",
"path": "mediatr/12.2.0",
"hashPath": "mediatr.12.2.0.nupkg.sha512"
},
"MediatR.Contracts/2.0.1": {
"type": "package",
"serviceable": true,
"sha512": "sha512-FYv95bNT4UwcNA+G/J1oX5OpRiSUxteXaUt2BJbRSdRNiIUNbggJF69wy6mnk2wYToaanpdXZdCwVylt96MpwQ==",
"path": "mediatr.contracts/2.0.1",
"hashPath": "mediatr.contracts.2.0.1.nupkg.sha512"
},
"Microsoft.CodeCoverage/17.3.2": {
"type": "package",
"serviceable": true,
Expand Down Expand Up @@ -1379,12 +1414,12 @@
"path": "microsoft.extensions.dependencyinjection/7.0.0",
"hashPath": "microsoft.extensions.dependencyinjection.7.0.0.nupkg.sha512"
},
"Microsoft.Extensions.DependencyInjection.Abstractions/7.0.0": {
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": {
"type": "package",
"serviceable": true,
"sha512": "sha512-h3j/QfmFN4S0w4C2A6X7arXij/M/OVw3uQHSOFxnND4DyAzO1F9eMX7Eti7lU/OkSthEE0WzRsfT/Dmx86jzCw==",
"path": "microsoft.extensions.dependencyinjection.abstractions/7.0.0",
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.7.0.0.nupkg.sha512"
"sha512": "sha512-cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==",
"path": "microsoft.extensions.dependencyinjection.abstractions/8.0.0",
"hashPath": "microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512"
},
"Microsoft.Extensions.DependencyModel/6.0.0": {
"type": "package",
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified GenericRepository.Tests/bin/Debug/net7.0/GenericRepository.dll
Binary file not shown.
Binary file modified GenericRepository.Tests/bin/Debug/net7.0/GenericRepository.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3dbd4bf0230f3a5df2440d4cbe8dfda86a0b65b5
9080cff8d28611616558fe7173d416495dda4df9
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,5 @@
/Users/macbook/Projects/Generic Repository/GenericRepository.Tests/obj/Debug/net7.0/GenericRepository.Tests.pdb
/Users/macbook/Projects/Generic Repository/GenericRepository.Tests/obj/Debug/net7.0/GenericRepository.Tests.genruntimeconfig.cache
/Users/macbook/Projects/Generic Repository/GenericRepository.Tests/obj/Debug/net7.0/ref/GenericRepository.Tests.dll
/Users/macbook/Projects/Generic Repository/GenericRepository.Tests/bin/Debug/net7.0/MediatR.dll
/Users/macbook/Projects/Generic Repository/GenericRepository.Tests/bin/Debug/net7.0/MediatR.Contracts.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,10 @@
"net7.0": {
"targetAlias": "net7.0",
"dependencies": {
"MediatR": {
"target": "Package",
"version": "[12.2.0, )"
},
"Microsoft.EntityFrameworkCore": {
"target": "Package",
"version": "[7.0.10, )"
Expand Down
74 changes: 69 additions & 5 deletions GenericRepository.Tests/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,36 @@
"build/netstandard1.0/coverlet.collector.targets": {}
}
},
"MediatR/12.2.0": {
"type": "package",
"dependencies": {
"MediatR.Contracts": "[2.0.1, 3.0.0)",
"Microsoft.Extensions.DependencyInjection.Abstractions": "8.0.0"
},
"compile": {
"lib/net6.0/MediatR.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/net6.0/MediatR.dll": {
"related": ".xml"
}
}
},
"MediatR.Contracts/2.0.1": {
"type": "package",
"compile": {
"lib/netstandard2.0/MediatR.Contracts.dll": {
"related": ".xml"
}
},
"runtime": {
"lib/netstandard2.0/MediatR.Contracts.dll": {
"related": ".xml"
}
}
},
"Microsoft.CodeCoverage/17.3.2": {
"type": "package",
"compile": {
Expand Down Expand Up @@ -172,7 +202,7 @@
"buildTransitive/net6.0/_._": {}
}
},
"Microsoft.Extensions.DependencyInjection.Abstractions/7.0.0": {
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": {
"type": "package",
"compile": {
"lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll": {
Expand Down Expand Up @@ -2180,6 +2210,7 @@
"type": "project",
"framework": ".NETCoreApp,Version=v7.0",
"dependencies": {
"MediatR": "12.2.0",
"Microsoft.EntityFrameworkCore": "7.0.10",
"Microsoft.EntityFrameworkCore.Abstractions": "7.0.10",
"Scrutor": "4.2.0"
Expand Down Expand Up @@ -2269,6 +2300,36 @@
"coverlet.collector.nuspec"
]
},
"MediatR/12.2.0": {
"sha512": "8TUFrHapKi6D74PhnSNEguRsH91HNGyP3R4ZQdgDorJgl9Wac5Prh0vA33QfrniAaS6L2xNNhc6vxzg+5AIbwA==",
"type": "package",
"path": "mediatr/12.2.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"gradient_128x128.png",
"lib/net6.0/MediatR.dll",
"lib/net6.0/MediatR.xml",
"lib/netstandard2.0/MediatR.dll",
"lib/netstandard2.0/MediatR.xml",
"mediatr.12.2.0.nupkg.sha512",
"mediatr.nuspec"
]
},
"MediatR.Contracts/2.0.1": {
"sha512": "FYv95bNT4UwcNA+G/J1oX5OpRiSUxteXaUt2BJbRSdRNiIUNbggJF69wy6mnk2wYToaanpdXZdCwVylt96MpwQ==",
"type": "package",
"path": "mediatr.contracts/2.0.1",
"files": [
".nupkg.metadata",
".signature.p7s",
"gradient_128x128.png",
"lib/netstandard2.0/MediatR.Contracts.dll",
"lib/netstandard2.0/MediatR.Contracts.xml",
"mediatr.contracts.2.0.1.nupkg.sha512",
"mediatr.contracts.nuspec"
]
},
"Microsoft.CodeCoverage/17.3.2": {
"sha512": "+CeYNY9hYNRgv1wAID5koeDVob1ZOrOYfRRTLxU9Zm5ZMDMkMZ8wzXgakxVv+jtk8tPdE8Ze9vVE+czMKapv/Q==",
"type": "package",
Expand Down Expand Up @@ -2518,15 +2579,16 @@
"useSharedDesignerContext.txt"
]
},
"Microsoft.Extensions.DependencyInjection.Abstractions/7.0.0": {
"sha512": "h3j/QfmFN4S0w4C2A6X7arXij/M/OVw3uQHSOFxnND4DyAzO1F9eMX7Eti7lU/OkSthEE0WzRsfT/Dmx86jzCw==",
"Microsoft.Extensions.DependencyInjection.Abstractions/8.0.0": {
"sha512": "cjWrLkJXK0rs4zofsK4bSdg+jhDLTaxrkXu4gS6Y7MAlCvRyNNgwY/lJi5RDlQOnSZweHqoyvgvbdvQsRIW+hg==",
"type": "package",
"path": "microsoft.extensions.dependencyinjection.abstractions/7.0.0",
"path": "microsoft.extensions.dependencyinjection.abstractions/8.0.0",
"files": [
".nupkg.metadata",
".signature.p7s",
"Icon.png",
"LICENSE.TXT",
"PACKAGE.md",
"THIRD-PARTY-NOTICES.TXT",
"buildTransitive/net461/Microsoft.Extensions.DependencyInjection.Abstractions.targets",
"buildTransitive/net462/_._",
Expand All @@ -2538,11 +2600,13 @@
"lib/net6.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
"lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
"lib/net7.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
"lib/net8.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
"lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
"lib/netstandard2.0/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
"lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.dll",
"lib/netstandard2.1/Microsoft.Extensions.DependencyInjection.Abstractions.xml",
"microsoft.extensions.dependencyinjection.abstractions.7.0.0.nupkg.sha512",
"microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512",
"microsoft.extensions.dependencyinjection.abstractions.nuspec",
"useSharedDesignerContext.txt"
]
Expand Down
6 changes: 4 additions & 2 deletions GenericRepository.Tests/obj/project.nuget.cache
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"version": 2,
"dgSpecHash": "njg6fgBNIKgbat3ZmRBjwhkUufTH43NBPCIhv11M51nvpA5uP0rrzfF6qtEQJFlbrC4AAYQhOY0RStybQ6CrxQ==",
"dgSpecHash": "RWCDK/SrPUqG8hGaIcr3DLEgSNFFoDOLbgr0UCloiyhMDR/rZVn9pRd/EITSyqxJdygQ5jWO1LI96vgxN7LoKA==",
"success": true,
"projectFilePath": "/Users/macbook/Projects/Generic Repository/GenericRepository.Tests/GenericRepository.Tests.csproj",
"expectedPackageFiles": [
"/Users/macbook/.nuget/packages/castle.core/5.1.1/castle.core.5.1.1.nupkg.sha512",
"/Users/macbook/.nuget/packages/coverlet.collector/3.1.2/coverlet.collector.3.1.2.nupkg.sha512",
"/Users/macbook/.nuget/packages/mediatr/12.2.0/mediatr.12.2.0.nupkg.sha512",
"/Users/macbook/.nuget/packages/mediatr.contracts/2.0.1/mediatr.contracts.2.0.1.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.codecoverage/17.3.2/microsoft.codecoverage.17.3.2.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.csharp/4.0.1/microsoft.csharp.4.0.1.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.entityframeworkcore/7.0.10/microsoft.entityframeworkcore.7.0.10.nupkg.sha512",
Expand All @@ -14,7 +16,7 @@
"/Users/macbook/.nuget/packages/microsoft.extensions.caching.abstractions/7.0.0/microsoft.extensions.caching.abstractions.7.0.0.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.extensions.caching.memory/7.0.0/microsoft.extensions.caching.memory.7.0.0.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.extensions.dependencyinjection/7.0.0/microsoft.extensions.dependencyinjection.7.0.0.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.extensions.dependencyinjection.abstractions/7.0.0/microsoft.extensions.dependencyinjection.abstractions.7.0.0.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.extensions.dependencyinjection.abstractions/8.0.0/microsoft.extensions.dependencyinjection.abstractions.8.0.0.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.extensions.dependencymodel/6.0.0/microsoft.extensions.dependencymodel.6.0.0.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.extensions.logging/7.0.0/microsoft.extensions.logging.7.0.0.nupkg.sha512",
"/Users/macbook/.nuget/packages/microsoft.extensions.logging.abstractions/7.0.0/microsoft.extensions.logging.abstractions.7.0.0.nupkg.sha512",
Expand Down
2 changes: 1 addition & 1 deletion GenericRepository.Tests/obj/rider.project.restore.info
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16923490756683483
17088530912153700
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GenericRepository.Abstractions.Interfaces.UnitOfWork;
using GenericRepository.Application.Interfaces.UnitOfWork;
using Microsoft.EntityFrameworkCore;

namespace GenericRepository.Abstractions;
namespace GenericRepository.Application.Abstractions;

public abstract class BaseRepository
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GenericRepository.Enumerations
namespace GenericRepository.Application.Enumerations
{
public enum OrderType
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Linq.Expressions;
using GenericRepository.Entities;
using Microsoft.EntityFrameworkCore.Storage;
using GenericRepository.Domain;

namespace GenericRepository.Abstractions.Interfaces.GenericRepository.Command;
namespace GenericRepository.Application.Interfaces.GenericRepository.Command;

public partial interface IRepository<T> where T : BaseEntity
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore.Storage;

namespace GenericRepository.Abstractions.Interfaces.GenericRepository.Command;
namespace GenericRepository.Application.Interfaces.GenericRepository.Command;

public partial interface IRepository<T>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq.Expressions;
using GenericRepository.Enumerations;
using GenericRepository.Application.Enumerations;

namespace GenericRepository.Abstractions.Interfaces.GenericRepository.Query;
namespace GenericRepository.Application.Interfaces.GenericRepository.Query;

public partial interface IQueryGenericRepository<T>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq.Expressions;
using GenericRepository.Enumerations;
using GenericRepository.Application.Enumerations;

namespace GenericRepository.Abstractions.Interfaces.GenericRepository.Query;
namespace GenericRepository.Application.Interfaces.GenericRepository.Query;

public partial interface IQueryGenericRepository<T>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Storage;

namespace GenericRepository.Abstractions.Interfaces.UnitOfWork;
namespace GenericRepository.Application.Interfaces.UnitOfWork;

public interface IUnitOfWork
{
Expand Down
Loading

0 comments on commit 4b8d520

Please sign in to comment.