public async Task <IActionResult> Put(Guid id, [FromBody] StaffDTO value) { var cmd = new UpdateStaffCommand(id, value); var result = await _mediator.Send(cmd); return(Ok(result)); }
public async Task <IActionResult> UpdateStaff([FromBody] UpdateStaffCommand command) { var response = await _mediator.Send(command); if (response.Status.IsSuccessful) { return(Ok(response)); } return(BadRequest(response)); }
public StaffViewModel() { //Initialising staff member properties this.FirstName = FirstName; this.SecondName = SecondName; this.OtherName = OtherName; this.Id = Id; this.Rank = Rank; this.PhoneNumber = PhoneNumber; this.Address = Address; StaffMember = new StaffCommand(); RefreshStaff = new UpdateStaffCommand(); }