Exemplo n.º 1
0
        public static OwnershipDTO ToDTO(this ChangeOwnerRequest owner)
        {
            OwnershipDTO dto = new OwnershipDTO
            {
                UserName = owner.PersonName,
                PersonId = owner.PersonId,
                From     = owner.From,
                To       = owner.To,
                UnitId   = owner.UnitId
            };

            return(dto);
        }
Exemplo n.º 2
0
 public async Task <IActionResult> ChangeOwner(Guid id, [FromBody] ChangeOwnerRequest request)
 => (await _mediator.Send(new ChangeOwnerCommand(id, request.NewOwner, _contextAccessor.CorrelationId)))
 .PipeTo(_ => new OkResult());
        public async Task <IActionResult> ChangeOwner([FromBody] ChangeOwnerRequest owner)
        {
            await _baseInfoApplicationService.ChangeOwnerAsync(owner);

            return(Ok());
        }
 public async Task ChangeOwnerAsync(ChangeOwnerRequest newOwner)
 {
     var owner = newOwner.ToDTO();
     await _buildingManager.UpdateOwnershipAsync(newOwner.OldFrom, owner).ConfigureAwait(false);
 }