© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago•
17 replies
Ares

How do i solve this type error?

  //Create
        [HttpPost]
        public async Task<IActionResult> Create(AddPollRequest addPollRequest)
        {
            var result = await HttpContext.AuthenticateAsync(
                 CookieAuthenticationDefaults.AuthenticationScheme
              );


            addPollRequest.UserId = await UserInformation.GetGoogleId(result); <-- this line

            var domainPoll = mapper.Map<Poll>(addPollRequest);
            await pollRepository.CreatePollAsync(domainPoll);
            return RedirectToAction("Index", "Home");

        }
  //Create
        [HttpPost]
        public async Task<IActionResult> Create(AddPollRequest addPollRequest)
        {
            var result = await HttpContext.AuthenticateAsync(
                 CookieAuthenticationDefaults.AuthenticationScheme
              );


            addPollRequest.UserId = await UserInformation.GetGoogleId(result); <-- this line

            var domainPoll = mapper.Map<Poll>(addPollRequest);
            await pollRepository.CreatePollAsync(domainPoll);
            return RedirectToAction("Index", "Home");

        }


why do i get,
CS1503 Argument 1: cannot convert from 'Microsoft.AspNetCore.Authentication.AuthenticateResult' to 'Microsoft.Identity.Client.AuthenticationResult
CS1503 Argument 1: cannot convert from 'Microsoft.AspNetCore.Authentication.AuthenticateResult' to 'Microsoft.Identity.Client.AuthenticationResult
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ How to solve this problem?
C#CC# / help
2y ago
✅ how do i fix this syntax error?
C#CC# / help
2y ago
how do i fix this unity error
C#CC# / help
3y ago
✅ Unrecognized escape sequence how do I solve it ?
C#CC# / help
2y ago