var formData = await context.Request.ReadFormAsync() as IEnumerable<KeyValuePair<string, string[]>>; var validateCode = formData.FirstOrDefault(x => x.Key == "ValidateCode").Value[0];