async Task <ConsentAnswer> TryGetConsentAnswerAsync(IOwinRequest request) { ConsentAnswer consentAnswer; if (request.IsPost()) { IFormCollection formCollection = await request.ReadFormAsync(); string consent = formCollection.Get(_options.HandleConsentOptions.ConsentParameterName); consentAnswer = ConsentAnswer.TryParse(consent); } else if (request.IsGet()) { string consent = request.Query.Get(_options.HandleConsentOptions.ConsentParameterName); consentAnswer = ConsentAnswer.TryParse(consent); } else { consentAnswer = ConsentAnswer.InvalidMethod; } return(consentAnswer); }
async Task<ConsentAnswer> TryGetConsentAnswerAsync(IOwinRequest request) { ConsentAnswer consentAnswer; if (request.IsPost()) { IFormCollection formCollection = await request.ReadFormAsync(); string consent = formCollection.Get(_options.HandleConsentOptions.ConsentParameterName); consentAnswer = ConsentAnswer.TryParse(consent); } else if (request.IsGet()) { string consent = request.Query.Get(_options.HandleConsentOptions.ConsentParameterName); consentAnswer = ConsentAnswer.TryParse(consent); } else { consentAnswer = ConsentAnswer.InvalidMethod; } return consentAnswer; }