public HttpResponseMessage Get(VolunteerRequest status) { var result = _service.GetByStatus(status); if (result == null) { return(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, result as IEnumerable <UserDto>)); }
public WebApiSuccessResponse Save(VolunteerRequest volunteerRequest) { var volunteerEntity = this.GetVolunteerEntity(User.Identity.GetVolunteerId()); _ctx.UpdateObject(_mapper.Map(volunteerRequest, volunteerEntity)); _ctx.SaveChanges(); return(new WebApiSuccessResponse()); }
public async Task<VolunteerResponse> VolunteerAsync (VolunteerRequest request) { await Task.Delay (2000); return new VolunteerResponse { Succeeded = true, Result = true }; }
public async Task <ActionResult> Put(Guid id, VolunteerRequest dto) { await _mediator.Send(new UpdateCommand(id, dto)); return(NoContent()); }
public async Task <ActionResult> Post(VolunteerRequest dto) { await _mediator.Send(new CreateCommand(dto)); return(NoContent()); }