Changeset 7146ebb for src/FinkiChattery/FinkiChattery.Api/Services
- Timestamp:
- 09/08/21 17:49:03 (3 years ago)
- Branches:
- dev
- Children:
- cba21c9
- Parents:
- cabaa79
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FinkiChattery/FinkiChattery.Api/Services/RegisterServices.cs
rcabaa79 r7146ebb 1 using FinkiChattery.Api.Services; 1 using FinkiChattery.Api.ApplicationServices.Authentication; 2 using FinkiChattery.Api.Services; 3 using FinkiChattery.Commands.Questioning; 2 4 using FinkiChattery.Common.Mediator; 3 5 using FinkiChattery.Common.Mediator.Interfaces; … … 6 8 using FinkiChattery.Persistence.Context; 7 9 using FinkiChattery.Persistence.Models; 10 using FinkiChattery.Persistence.Repositories; 8 11 using Hangfire; 9 12 using Hangfire.SqlServer; 10 13 using MediatR; 11 14 using Microsoft.AspNetCore.Authentication.JwtBearer; 15 using Microsoft.AspNetCore.Authorization; 12 16 using Microsoft.AspNetCore.Http; 13 17 using Microsoft.AspNetCore.Identity; … … 25 29 services.AddScoped<IEventService, EventService>(); 26 30 services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>)); 27 28 // TODO: REGISTER MEDIATOR HANDLERS WHEN WE CREATE FIRST COMMAND SMENI SO DOMAIN KLASA 29 services.AddMediatR(typeof(RegisterServices)); 31 services.AddMediatR(typeof(AskQuestionCommand)); 30 32 } 31 33 … … 74 76 }); 75 77 76 services.AddAuthorization(); 78 services.AddScoped<IAuthorizationHandler, CurrentUserIsOfRoleRequirementHandler>(); 79 80 services.AddAuthorization(options => 81 { 82 options.AddPolicy(AuthenticationPolicy.Student, policy => policy.Requirements.Add(new StudentRequirement())); 83 84 }); 77 85 } 78 86 … … 94 102 public static void AddRepos(this IServiceCollection services) 95 103 { 104 services.AddScoped<ICategoriesRepo, CategoriesRepo>(); 105 services.AddScoped<ITeamRepo, TeamRepo>(); 106 services.AddScoped<IQuestionRepo, QuestionRepo>(); 107 services.AddScoped<IStudentRepo, StudentRepo>(); 96 108 } 97 109
Note:
See TracChangeset
for help on using the changeset viewer.