- Timestamp:
- 10/31/21 12:13:35 (3 years ago)
- Branches:
- dev
- Children:
- 7c3e6a8
- Parents:
- ad0fcd3
- Location:
- src/FinkiChattery
- Files:
-
- 15 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/FinkiChattery/FinkiChattery.Api/Services/RegisterServices.cs
rad0fcd3 rad079e5 1 1 using FinkiChattery.Api.ApplicationServices.Authentication; 2 using FinkiChattery.Api.ApplicationServices.Questioning.EventHandlers; 2 3 using FinkiChattery.Api.Services; 3 4 using FinkiChattery.Commands.Questioning; … … 31 32 services.AddScoped<IEventService, EventService>(); 32 33 services.AddTransient(typeof(IPipelineBehavior<,>), typeof(ValidationBehavior<,>)); 33 services.AddMediatR(typeof(AskQuestionCommand), typeof(GetQuestionStateQuery) );34 services.AddMediatR(typeof(AskQuestionCommand), typeof(GetQuestionStateQuery), typeof(UpdateAnswerVotesEventHandler)); 34 35 } 35 36 … … 54 55 }); 55 56 services.AddHangfireServer(); 57 58 services.AddScoped<IBackgroundJobClient>(provider => 59 { 60 return new BackgroundJobClient(JobStorage.Current); 61 }); 56 62 } 57 63 -
src/FinkiChattery/FinkiChattery.Commands/Questioning/QuestioningErrorCodes.cs
rad0fcd3 rad079e5 9 9 public const string CategoriesDontExist = "CategoriesDontExist"; 10 10 public const string TeamDontExist = "TeamDontExist"; 11 public const string AnswerAlreadyUpvoted = "AnswerAlreadyUpvoted"; 12 public const string AnswerAlreadyDownvoted = "AnswerAlreadyDownvoted"; 13 public const string StudentHasBadReputation = "StudentHasBadReputation"; 11 14 } 12 15 } -
src/FinkiChattery/FinkiChattery.Commands/Questioning/Validators/CategoriesUidsExist.cs
rad0fcd3 rad079e5 1 using FinkiChattery.Persistence.Repositories; 2 using FinkiChattery.Persistence.UnitOfWork; 1 using FinkiChattery.Persistence.UnitOfWork; 3 2 using FluentValidation.Validators; 4 3 using System; -
src/FinkiChattery/FinkiChattery.Persistence/Models/Student.cs
rad0fcd3 rad079e5 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Text; 5 using System.Threading.Tasks; 1 using System.Collections.Generic; 6 2 7 3 namespace FinkiChattery.Persistence.Models … … 22 18 23 19 public virtual ICollection<Question> Questions { get; set; } 24 20 25 21 public virtual ICollection<Answer> Answers { get; set; } 26 22 27 23 public virtual ICollection<StudentTeam> StudentTeams { get; set; } 28 24 } -
src/FinkiChattery/FinkiChattery.Persistence/Models/Vote.cs
rad0fcd3 rad079e5 5 5 public class Vote : BaseEntity 6 6 { 7 public Vote() : base() 8 { 9 } 10 7 11 public long StudentFk { get; set; } 8 12 -
src/FinkiChattery/FinkiChattery.Persistence/UnitOfWork/Contracts/IUnitOfWork.cs
rad0fcd3 rad079e5 11 11 IStudentRepo Students { get; } 12 12 ITeamRepo Teams { get; } 13 IVoteRepo Votes { get; } 14 IAnswerRepo Answers { get; } 13 15 Task<int> SaveAsync(); 14 16 } -
src/FinkiChattery/FinkiChattery.Persistence/UnitOfWork/Implementations/UnitOfWork.cs
rad0fcd3 rad079e5 12 12 private StudentRepo _students; 13 13 private TeamRepo _teams; 14 private VoteRepo _votes; 15 private AnswerRepo _answers; 14 16 15 17 public UnitOfWork(ApplicationDbContext dbContext) … … 70 72 } 71 73 74 public IVoteRepo Votes 75 { 76 get 77 { 78 if (_votes == null) 79 { 80 _votes = new VoteRepo(DbContext); 81 } 82 83 return _votes; 84 } 85 } 86 87 public IAnswerRepo Answers 88 { 89 get 90 { 91 if (_answers == null) 92 { 93 _answers = new AnswerRepo(DbContext); 94 } 95 96 return _answers; 97 } 98 } 99 72 100 public ApplicationDbContext DbContext { get; } 73 101
Note:
See TracChangeset
for help on using the changeset viewer.