public async Task<IHttpActionResult> GetPatientAppointmentTask(ILoggedInPerson loggedInPerson, int appointmentId) { return await TryAsync(async () => { var baseByIdQuery = new BaseByIdQuery { Id = appointmentId }; var result = await QueryDispatcher.Dispatch<BaseByIdQuery, AppointmentQueryResult>(baseByIdQuery); return Ok(result.Appointment); }, memberParameters: new object[] { loggedInPerson, appointmentId }); }
public async Task<IHttpActionResult> GetPatientProfileTask(ILoggedInPerson loggedInPerson, int id) { return await TryAsync(async () => { var baseByIdQuery = new BaseByIdQuery {Id = id}; var result = await QueryDispatcher.Dispatch<BaseByIdQuery, PatientProfileQueryResult>(baseByIdQuery); return Ok(result.Patient); }, memberParameters: new object[] { loggedInPerson, id }); }
public async Task<IHttpActionResult> GetAllStates(ILoggedInPerson loggedInPerson) { return await TryAsync(async () => { var baseByIdQuery = new BaseByIdQuery(); var result = await QueryDispatcher.Dispatch<BaseByIdQuery, StateQueryResult>(baseByIdQuery); return Ok(result.States); }, memberParameters: new object[] { loggedInPerson }); }
public async Task <IHttpActionResult> GetPlayersTask(ILoggedInPerson loggedInPerson, int playerId, string playerName) { return(await TryAsync(async() => { var baseByIdQuery = new BaseByIdQuery(); var result = await QueryDispatcher.Dispatch <BaseByIdQuery, StateQueryResult>(baseByIdQuery); return Ok(result.States); }, memberParameters : new object[] { loggedInPerson })); }
public async Task <IHttpActionResult> GetContestByIdTask(ILoggedInPerson loggedInPerson, int id) { return(await TryAsync(async() => { var baseByIdQuery = new BaseByIdQuery { Id = id }; var result = await QueryDispatcher.Dispatch <BaseByIdQuery, ContestByIdQueryResult>(baseByIdQuery); return Ok(result.Contest); }, memberParameters : new object[] { loggedInPerson })); }
public async Task <IHttpActionResult> UpdateContestTask(ILoggedInPerson loggedInPerson, [FromBody] ContestEntry contestEntry) { return(await TryAsync(async() => { var command = new EnterContestCommand { ContestEntry = contestEntry, UserId = loggedInPerson.Id }; var result = await CommandDispatcher.Dispatch(command); return Ok(result); }, memberParameters : new object[] { loggedInPerson, contestEntry })); }
public async Task<IHttpActionResult> GetAllPatientProfilesTaskAdmin(ILoggedInPerson loggedInPerson) { return await TryAsync(async () => { var baseByIdQuery = new BaseByIdQuery { UserId = "" }; var result = await QueryDispatcher.Dispatch<BaseByIdQuery, PatientProfilesQueryResult>(baseByIdQuery); return new CustomOkResult<IEnumerable<Patient>>(result.Patients, this) { XInlineCount = result.TotalRecords.ToString() }; }, memberParameters: new object[] { loggedInPerson }); }
public async Task<IHttpActionResult> GetAllPatientAppointmentsTask(ILoggedInPerson loggedInPerson, int patientId) { return await TryAsync(async () => { var baseByIdQuery = new BaseByIdQuery{Id = patientId, UserId = loggedInPerson.Id}; var result = await QueryDispatcher.Dispatch<BaseByIdQuery, AppointmentsQueryResult>(baseByIdQuery); return new CustomOkResult<IEnumerable<Appointment>>(result.Appointments, this) { XInlineCount = result.TotalRecords.ToString() }; }, memberParameters: new object[] { loggedInPerson, patientId }); }
public async Task <IHttpActionResult> GetAllContestsTask(ILoggedInPerson loggedInPerson) { return(await TryAsync(async() => { var baseByIdQuery = new BaseByIdQuery(); var result = await QueryDispatcher.Dispatch <BaseByIdQuery, ContestQueryResult>(baseByIdQuery); return new CustomOkResult <IEnumerable <Contests> >(result.Contests, this) { XInlineCount = result.TotalRecords.ToString() }; }, memberParameters : new object[] { loggedInPerson })); }
public async Task<IHttpActionResult> UpdatePatientProfileTask(ILoggedInPerson loggedInPerson, PatientProfile patientProfile) { return await TryAsync(async () => { var command = new UpdatePatientProfileCommand { PatientProfile = patientProfile }; var result = await CommandDispatcher.Dispatch(command); return Ok(result); }, memberParameters: new object[] { loggedInPerson, patientProfile }); }
public async Task<IHttpActionResult> UpdatePatientAppointmentTask(ILoggedInPerson loggedInPerson, [FromBody]Appointment appointment) { return await TryAsync(async () => { var command = new UpdatePatientAppointmentCommand { Appointment = appointment }; var result = await CommandDispatcher.Dispatch(command); return Ok(result); }, memberParameters: new object[] { loggedInPerson, appointment }); }