Exemplo n.º 1
0
        public async Task <Unit> Handle(CreateRecruitingPipelineCommand request, CancellationToken cancellationToken)
        {
            var user = _userAccessor.GetUser();

            var entity = new RecruitmentPipeline()
            {
                Name        = request.Name,
                Description = request.Description
            };

            await _context.RecruitingPipelines.AddAsync(entity, cancellationToken);

            await _context.SaveChangesAsync(cancellationToken);

            // Notifications
            var notification = new RecruitingPipelineCreated
            {
                PrimaryEntityId   = entity.Id,
                PrimaryEntityName = entity.Name,
                UserName          = user.Identity.Name
            };
            await _mediator.Publish(notification, cancellationToken);

            return(Unit.Value);
        }
Exemplo n.º 2
0
 public static RecruitingPipelineLookupModel Create(RecruitmentPipeline pipeline)
 {
     return(Projection.Compile().Invoke(pipeline));
 }