File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ using CanBeYours . Application . Services . DemoThings ;
2+ using Microsoft . Extensions . DependencyInjection ;
3+
4+ namespace CanBeYours . Application ;
5+
6+ public static class Startup
7+ {
8+ public static void AddApplicationModule ( this IServiceCollection services )
9+ {
10+ //services.RegisterHandlers(typeof(Startup));
11+
12+ services . AddScoped < IDemoThingService , DemoThingService > ( ) ;
13+ }
14+ }
Original file line number Diff line number Diff line change 1- using CanBeYours . Application . Services . DemoThings ;
1+ using CanBeYours . Application ;
22using CanBeYours . Core . Domain . DemoThings ;
33using CanBeYours . Infrastructure . DbContext ;
44using CanBeYours . Infrastructure . Mapping ;
@@ -14,12 +14,11 @@ public static class Startup
1414{
1515 public static void AddInfrastructureModule ( this IServiceCollection services )
1616 {
17+ services . AddApplicationModule ( ) ;
1718 services . RegisterHandlers ( typeof ( Startup ) ) ;
1819 services . AddMongoDbContext ( ) ;
1920 services . AddDomainServices ( ) ;
20- services . AddServices ( ) ;
2121 services . AddMappingProfileFromAssemblyContaining < DemoThingMappingProfile > ( ) ;
22- services . RegisterBaseModule ( typeof ( Startup ) . Assembly ) ;
2322 services . AddValidatorsFromAssembly ( typeof ( Startup ) . Assembly ) ;
2423 }
2524
@@ -37,9 +36,4 @@ public static void AddDomainServices(this IServiceCollection services)
3736 {
3837 services . AddScoped < IDemoThingRepository , DemoThingRepository > ( ) ;
3938 }
40-
41- public static void AddServices ( this IServiceCollection services )
42- {
43- services . AddScoped < IDemoThingService , DemoThingService > ( ) ;
44- }
4539}
Original file line number Diff line number Diff line change 1- @using CanBeYours .Application .Dtos
2- @using CanBeYours .Application .Services .DemoThings
3- @using CanBeYours .AdminPanel .Resources
4- @using CodeBlock .DevKit .Web .Blazor .Components .Dialogs
5- @using CodeBlock .DevKit .Web .Blazor .Components .Forms
6- @using Microsoft .Extensions .Localization
7-
8- @inject IStringLocalizer <AdminPanelResource > L
9- @inject IDemoThingService DemoThingService
1+
102
113<EditForm Model =" Input" OnValidSubmit =" HandleCreateDemoThing" >
124 <DataAnnotationsValidator />
Original file line number Diff line number Diff line change 1- @using CanBeYours .Application .Dtos
2-
31<div class =" table-responsive text-nowrap" >
42 <table class =" table table-hover mt-3" >
53 <thead >
Original file line number Diff line number Diff line change 1- @using CanBeYours .Application .Dtos
2-
31<EditForm Model =" SearchDemoThingsInputDto" OnSubmit =" HandleSearchDemoThings" class =" row gy-2 gx-3 align-items-center" >
42
53 <div class =" col-12" >
Original file line number Diff line number Diff line change 11@using CanBeYours .Application .Dtos
22@using CanBeYours .Application .Services .DemoThings
33@using CanBeYours .AdminPanel .Resources
4- @using CodeBlock .DevKit .Web .Blazor .Components .Dialogs
5- @using CodeBlock .DevKit .Web .Blazor .Components .Forms
64@using Microsoft .Extensions .Localization
75
86@inject IStringLocalizer <AdminPanelResource > L
Original file line number Diff line number Diff line change 11@page " /demo-things"
2- @attribute [Authorize]
32@implements IDisposable
43
54<PageTitle >@AdminPanelLocalizer [AdminPanelResource.DemoThings]</PageTitle >
Original file line number Diff line number Diff line change 11@using CanBeYours .AdminPanel .Pages
22@using CanBeYours .AdminPanel .Pages .Shared
3+ @using CanBeYours .Core .Resources
34@using CodeBlock .DevKit .Clients .AdminPanel .Pages
45@using CodeBlock .DevKit .Clients .AdminPanel .Pages .Shared
56@using System .Net .Http
2324@using CanBeYours .AdminPanel .Resources
2425@using CodeBlock .DevKit .Web .Security ;
2526@using CodeBlock .DevKit .Contracts .Models
27+ @using CanBeYours .Application .Dtos
28+ @using CanBeYours .Application .Services .DemoThings
29+ @using CanBeYours .AdminPanel .Resources
30+
31+ @using CanBeYours .AdminPanel .Pages .DemoThings .Components
32+ @using CodeBlock .DevKit .Contracts .Dtos
2633
2734@attribute [Authorize(Policy = Policies.ADMIN_ROLE)]
2835@inject IStringLocalizer <AdminPanelResource > AdminPanelLocalizer
36+ @inject IStringLocalizer <SharedResource > SharedLocalizer
2937@inject IStringLocalizer <CoreResource > CoreLocalizer
38+ @inject IDemoThingService DemoThingService
Original file line number Diff line number Diff line change 11using CanBeYours . Application . Dtos ;
22using CanBeYours . Application . Services . DemoThings ;
33using CodeBlock . DevKit . Contracts . Dtos ;
4- using CodeBlock . DevKit . Contracts . Helpers ;
54using CodeBlock . DevKit . Core . Helpers ;
5+ using CodeBlock . DevKit . Web . Api . Filters ;
6+ using CodeBlock . DevKit . Web . Security ;
67using Microsoft . AspNetCore . Authorization ;
78using Microsoft . AspNetCore . Mvc ;
89
910namespace CanBeYours . Api . Controllers ;
1011
1112[ Tags ( "DemoThings" ) ]
1213[ Route ( "demo-things" ) ]
13- [ Authorize ]
14+ [ Authorize ( Policies . ADMIN_ROLE ) ]
1415public class DemoThingsController : BaseApiController
1516{
1617 private readonly IDemoThingService _demoThingService ;
@@ -66,8 +67,8 @@ public async Task<Result<SearchOutputDto<GetDemoThingDto>>> Get(
6667 Term = term ,
6768 PageNumber = pageNumber ,
6869 RecordsPerPage = recordsPerPage ,
69- SortOrder = sortOrder
70+ SortOrder = sortOrder ,
7071 } ;
7172 return await _demoThingService . SearchDemoThings ( dto ) ;
7273 }
73- }
74+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments