Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CleanArchitecture
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CleanArchitecture
Commits
37261dcf
Commit
37261dcf
authored
Dec 02, 2019
by
James Yeung
Committed by
Steve Smith
Dec 02, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move interfaces from core to shared kernel project (#92)
parent
23adf414
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
45 additions
and
43 deletions
+45
-43
DatabasePopulator.cs
src/CleanArchitecture.Core/DatabasePopulator.cs
+1
-1
ItemCompletedEmailNotificationHandler.cs
...re.Core/Handlers/ItemCompletedEmailNotificationHandler.cs
+1
-1
ContainerSetup.cs
src/CleanArchitecture.Infrastructure/ContainerSetup.cs
+29
-27
AppDbContext.cs
src/CleanArchitecture.Infrastructure/Data/AppDbContext.cs
+1
-1
EfRepository.cs
src/CleanArchitecture.Infrastructure/Data/EfRepository.cs
+1
-1
DomainEventDispatcher.cs
...ture.Infrastructure/DomainEvents/DomainEventDispatcher.cs
+1
-1
IDomainEventDispatcher.cs
...tecture.SharedKernel/Interfaces/IDomainEventDispatcher.cs
+1
-1
IHandle.cs
src/CleanArchitecture.SharedKernel/Interfaces/IHandle.cs
+1
-1
IRepository.cs
src/CleanArchitecture.SharedKernel/Interfaces/IRepository.cs
+2
-2
ToDoItemsController.cs
src/CleanArchitecture.Web/Api/ToDoItemsController.cs
+1
-1
ToDoController.cs
src/CleanArchitecture.Web/Controllers/ToDoController.cs
+1
-1
Index.cshtml.cs
...CleanArchitecture.Web/Pages/ToDoRazorPage/Index.cshtml.cs
+1
-1
Populate.cshtml.cs
...anArchitecture.Web/Pages/ToDoRazorPage/Populate.cshtml.cs
+1
-1
CustomWebApplicationFactory.cs
...chitecture.FunctionalTests/CustomWebApplicationFactory.cs
+1
-1
BaseEfRepoTestFixture.cs
...chitecture.IntegrationTests/Data/BaseEfRepoTestFixture.cs
+1
-1
NoOpDomainEventDispatcher.cs
tests/CleanArchitecture.Tests/NoOpDomainEventDispatcher.cs
+1
-1
No files found.
src/CleanArchitecture.Core/DatabasePopulator.cs
View file @
37261dcf
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
System.Linq
;
namespace
CleanArchitecture.Core
...
...
src/CleanArchitecture.Core/Handlers/ItemCompletedEmailNotificationHandler.cs
View file @
37261dcf
using
System.Threading.Tasks
;
using
Ardalis.GuardClauses
;
using
CleanArchitecture.Core.Events
;
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
namespace
CleanArchitecture.Core.Services
{
...
...
src/CleanArchitecture.Infrastructure/ContainerSetup.cs
View file @
37261dcf
using
Autofac
;
using
Autofac.Extensions.DependencyInjection
;
using
CleanArchitecture.Core.Interfaces
;
using
CleanArchitecture.Infrastructure.Data
;
using
Microsoft.Extensions.DependencyInjection
;
using
System
;
using
Autofac
;
using
Autofac.Extensions.DependencyInjection
;
using
CleanArchitecture.Core
;
using
CleanArchitecture.SharedKernel.Interfaces
;
using
CleanArchitecture.Infrastructure.Data
;
using
Microsoft.Extensions.DependencyInjection
;
using
System
;
using
System.Reflection
;
namespace
CleanArchitecture.Infrastructure
{
public
static
class
ContainerSetup
{
public
static
IServiceProvider
InitializeWeb
(
Assembly
webAssembly
,
IServiceCollection
services
)
=>
new
AutofacServiceProvider
(
BaseAutofacInitialization
(
setupAction
=>
{
setupAction
.
Populate
(
services
);
setupAction
.
RegisterAssemblyTypes
(
webAssembly
).
AsImplementedInterfaces
();
}));
public
static
IContainer
BaseAutofacInitialization
(
Action
<
ContainerBuilder
>
setupAction
=
null
)
{
var
builder
=
new
ContainerBuilder
();
var
coreAssembly
=
Assembly
.
GetAssembly
(
typeof
(
IRepository
));
var
infrastructureAssembly
=
Assembly
.
GetAssembly
(
typeof
(
EfRepository
));
builder
.
RegisterAssemblyTypes
(
coreAssembly
,
infrastructureAssembly
).
AsImplementedInterfaces
();
setupAction
?.
Invoke
(
builder
);
return
builder
.
Build
();
}
}
public
static
class
ContainerSetup
{
public
static
IServiceProvider
InitializeWeb
(
Assembly
webAssembly
,
IServiceCollection
services
)
=>
new
AutofacServiceProvider
(
BaseAutofacInitialization
(
setupAction
=>
{
setupAction
.
Populate
(
services
);
setupAction
.
RegisterAssemblyTypes
(
webAssembly
).
AsImplementedInterfaces
();
}));
public
static
IContainer
BaseAutofacInitialization
(
Action
<
ContainerBuilder
>
setupAction
=
null
)
{
var
builder
=
new
ContainerBuilder
();
var
coreAssembly
=
Assembly
.
GetAssembly
(
typeof
(
DatabasePopulator
));
var
infrastructureAssembly
=
Assembly
.
GetAssembly
(
typeof
(
EfRepository
));
var
sharedKernelAssembly
=
Assembly
.
GetAssembly
(
typeof
(
IRepository
));
builder
.
RegisterAssemblyTypes
(
sharedKernelAssembly
,
coreAssembly
,
infrastructureAssembly
).
AsImplementedInterfaces
();
setupAction
?.
Invoke
(
builder
);
return
builder
.
Build
();
}
}
}
src/CleanArchitecture.Infrastructure/Data/AppDbContext.cs
View file @
37261dcf
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
Microsoft.EntityFrameworkCore
;
using
System.Linq
;
using
System.Threading
;
...
...
src/CleanArchitecture.Infrastructure/Data/EfRepository.cs
View file @
37261dcf
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
CleanArchitecture.Core.SharedKernel
;
using
Microsoft.EntityFrameworkCore
;
using
System.Collections.Generic
;
...
...
src/CleanArchitecture.Infrastructure/DomainEvents/DomainEventDispatcher.cs
View file @
37261dcf
using
Autofac
;
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
CleanArchitecture.Core.SharedKernel
;
using
System
;
using
System.Collections
;
...
...
src/CleanArchitecture.
Core
/Interfaces/IDomainEventDispatcher.cs
→
src/CleanArchitecture.
SharedKernel
/Interfaces/IDomainEventDispatcher.cs
View file @
37261dcf
using
System.Threading.Tasks
;
using
CleanArchitecture.Core.SharedKernel
;
namespace
CleanArchitecture.
Core
.Interfaces
namespace
CleanArchitecture.
SharedKernel
.Interfaces
{
public
interface
IDomainEventDispatcher
{
...
...
src/CleanArchitecture.
Core
/Interfaces/IHandle.cs
→
src/CleanArchitecture.
SharedKernel
/Interfaces/IHandle.cs
View file @
37261dcf
using
System.Threading.Tasks
;
using
CleanArchitecture.Core.SharedKernel
;
namespace
CleanArchitecture.
Core
.Interfaces
namespace
CleanArchitecture.
SharedKernel
.Interfaces
{
public
interface
IHandle
<
in
T
>
where
T
:
BaseDomainEvent
{
...
...
src/CleanArchitecture.
Core
/Interfaces/IRepository.cs
→
src/CleanArchitecture.
SharedKernel
/Interfaces/IRepository.cs
View file @
37261dcf
using
CleanArchitecture.Core.SharedKernel
;
using
System.Collections.Generic
;
namespace
CleanArchitecture.
Core
.Interfaces
namespace
CleanArchitecture.
SharedKernel
.Interfaces
{
public
interface
IRepository
{
...
...
@@ -11,4 +11,4 @@ namespace CleanArchitecture.Core.Interfaces
void
Update
<
T
>(
T
entity
)
where
T
:
BaseEntity
;
void
Delete
<
T
>(
T
entity
)
where
T
:
BaseEntity
;
}
}
}
\ No newline at end of file
src/CleanArchitecture.Web/Api/ToDoItemsController.cs
View file @
37261dcf
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
CleanArchitecture.Web.ApiModels
;
using
CleanArchitecture.Web.Filters
;
using
Microsoft.AspNetCore.Mvc
;
...
...
src/CleanArchitecture.Web/Controllers/ToDoController.cs
View file @
37261dcf
using
CleanArchitecture.Core
;
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
CleanArchitecture.Web.ApiModels
;
using
Microsoft.AspNetCore.Mvc
;
using
System.Linq
;
...
...
src/CleanArchitecture.Web/Pages/ToDoRazorPage/Index.cshtml.cs
View file @
37261dcf
using
CleanArchitecture.Core.Entities
;
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
Microsoft.AspNetCore.Mvc.RazorPages
;
using
System.Collections.Generic
;
...
...
src/CleanArchitecture.Web/Pages/ToDoRazorPage/Populate.cshtml.cs
View file @
37261dcf
using
CleanArchitecture.Core
;
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
Microsoft.AspNetCore.Mvc.RazorPages
;
namespace
CleanArchitecture.Web.Pages.ToDoRazorPage
...
...
tests/CleanArchitecture.FunctionalTests/CustomWebApplicationFactory.cs
View file @
37261dcf
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
CleanArchitecture.Infrastructure.Data
;
using
CleanArchitecture.UnitTests
;
using
CleanArchitecture.Web
;
...
...
tests/CleanArchitecture.IntegrationTests/Data/BaseEfRepoTestFixture.cs
View file @
37261dcf
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
CleanArchitecture.Infrastructure.Data
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.Extensions.DependencyInjection
;
...
...
tests/CleanArchitecture.Tests/NoOpDomainEventDispatcher.cs
View file @
37261dcf
using
System.Threading.Tasks
;
using
CleanArchitecture.
Core
.Interfaces
;
using
CleanArchitecture.
SharedKernel
.Interfaces
;
using
CleanArchitecture.Core.SharedKernel
;
namespace
CleanArchitecture.UnitTests
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment