-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removing domainEvents from BaseDbContext
- Loading branch information
1 parent
bfd213a
commit 294f2cc
Showing
20 changed files
with
101 additions
and
144 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Modules.Channels.Features.Infrastructure.EFCore; | ||
using Shared.Features.Modules; | ||
using System.Reflection; | ||
|
||
namespace Modules.Subscriptions.Features | ||
{ | ||
public class ChannelsModule : IModule | ||
{ | ||
public Assembly FeaturesAssembly => typeof(ChannelsModule).Assembly; | ||
public ChannelsDbContext ChannelsDbContext { get; set; } | ||
|
||
public ChannelsModule(ChannelsDbContext dbContext) | ||
{ | ||
ChannelsDbContext = dbContext; | ||
} | ||
} | ||
} |
15 changes: 8 additions & 7 deletions
15
...e/Modules/Channels/Features/DomainFeatures/Channels/Application/Commands/DeleteChannel.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
13 changes: 9 additions & 4 deletions
13
...e/Modules/Channels/Features/DomainFeatures/Channels/Application/Queries/GetAllChannels.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,18 +1,23 @@ | ||
using Modules.Channels.Features.Infrastructure.EFCore; | ||
using Modules.Subscriptions.Features; | ||
using Shared.Features.Messaging.Query; | ||
using Shared.Features.Server; | ||
|
||
namespace Modules.Channels.Features.DomainFeatures.Channels.Application.Queries | ||
{ | ||
public class GetAllChannels : Query<List<Channel>> | ||
{ | ||
|
||
} | ||
public class AllChannelsQueryHandler : BaseQueryHandler<ChannelsDbContext, Channel>, IQueryHandler<GetAllChannels, List<Channel>> | ||
public class AllChannelsQueryHandler : ServerExecutionBase<ChannelsModule>, IQueryHandler<GetAllChannels, List<Channel>> | ||
{ | ||
public AllChannelsQueryHandler(ChannelsDbContext applicationDbContext) : base(applicationDbContext) { } | ||
public async Task<List<Channel>> HandleAsync(GetAllChannels query, CancellationToken cancellation) | ||
public AllChannelsQueryHandler(IServiceProvider serviceProvider) : base(serviceProvider) | ||
{ | ||
return dbSet.ToList(); | ||
} | ||
|
||
public Task<List<Channel>> HandleAsync(GetAllChannels query, CancellationToken cancellation) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
13 changes: 9 additions & 4 deletions
13
...Channels/Features/DomainFeatures/Channels/Application/Queries/GetAllMessagesForChannel.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,18 +1,23 @@ | ||
using Modules.Channels.Features.Infrastructure.EFCore; | ||
using Modules.Subscriptions.Features; | ||
using Shared.Features.Messaging.Query; | ||
using Shared.Features.Server; | ||
|
||
namespace Modules.Channels.Features.DomainFeatures.Channels.Application.Queries | ||
{ | ||
public class AllMessagesForChannel : Query<List<Channel>> | ||
{ | ||
|
||
} | ||
public class AllMessagesForChannelQueryHandler : BaseQueryHandler<ChannelsDbContext, Channel>, IQueryHandler<GetAllChannels, List<Channel>> | ||
public class AllMessagesForChannelQueryHandler : ServerExecutionBase<ChannelsModule>, IQueryHandler<GetAllChannels, List<Channel>> | ||
{ | ||
public AllMessagesForChannelQueryHandler(ChannelsDbContext applicationDbContext) : base(applicationDbContext) { } | ||
public async Task<List<Channel>> HandleAsync(GetAllChannels query, CancellationToken cancellation) | ||
public AllMessagesForChannelQueryHandler(IServiceProvider serviceProvider) : base(serviceProvider) | ||
{ | ||
return dbSet.ToList(); | ||
} | ||
|
||
public Task<List<Channel>> HandleAsync(GetAllChannels query, CancellationToken cancellation) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
11 changes: 8 additions & 3 deletions
11
...e/Modules/Channels/Features/DomainFeatures/Channels/Application/Queries/GetChannelById.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,19 +1,24 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using Modules.Channels.Features.Infrastructure.EFCore; | ||
using Modules.Subscriptions.Features; | ||
using Shared.Features.Messaging.Query; | ||
using Shared.Features.Server; | ||
|
||
namespace Modules.Channels.Features.DomainFeatures.Channels.Application.Queries | ||
{ | ||
public class GetChannelById : Query<Channel> | ||
{ | ||
public Guid Id { get; set; } | ||
} | ||
public class GetChannelQueryHandler : BaseQueryHandler<ChannelsDbContext, Channel>, IQueryHandler<GetChannelById, Channel> | ||
public class GetChannelQueryHandler : ServerExecutionBase<ChannelsModule>, IQueryHandler<GetChannelById, Channel> | ||
{ | ||
public GetChannelQueryHandler(ChannelsDbContext applicationDbContext) : base(applicationDbContext) { } | ||
public GetChannelQueryHandler(IServiceProvider serviceProvider) : base(serviceProvider) | ||
{ | ||
} | ||
|
||
public Task<Channel> HandleAsync(GetChannelById query, CancellationToken cancellation) | ||
{ | ||
return dbSet.SingleAsync(c => c.Id == query.Id); | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
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
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
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.