Tutorial by Examples

This is an example of an attribute that I created to validate that required parameters have been assigned in the request object receive in a POST route. I decided on this approach because the standard ModelState.IsValid approach was not valid. This is because the required attributes vary based on wh...
[HttpPost] [Route("api/Fitbit/Activity/Stats")] public async Task<HttpResponseMessage> ActivityStats(FitbitRequestDTO request) { if (string.IsNullOrEmpty(request.PatientId) || string.IsNullOrEmpty(request.DeviceId)) ret...
public async Task<HttpResponseMessage> ActivityStats(FitbitRequestDTO request) { try { var tokenErrorResponse = await EnsureToken(request); if (tokenErrorResponse != null) return tokenErrorRespons...

Page 1 of 1