Exemplo n.º 1
0
        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>));
        }
Exemplo n.º 2
0
        public WebApiSuccessResponse Save(VolunteerRequest volunteerRequest)
        {
            var volunteerEntity = this.GetVolunteerEntity(User.Identity.GetVolunteerId());

            _ctx.UpdateObject(_mapper.Map(volunteerRequest, volunteerEntity));

            _ctx.SaveChanges();

            return(new WebApiSuccessResponse());
        }
Exemplo n.º 3
0
		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());
        }