© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
2 replies
Natty

❔ [FromBody] and async issues...

I have this code:
 public DataFactoryController(AppIdealContext db)
        {
            _db = db;
            _client = CreateClientAsync().GetAwaiter().GetResult();
        }

        [HttpPost("TriggerPipelineOne")]
        public async Task<IActionResult> TriggerPipelineOneAsync([FromBody] PipelineOneUserSettingsRequest request)
        {
            var userSettings = ConvertUserSettingsObjectToDictionary(request);
            string pipelineOne = Environment.GetEnvironmentVariable(PIPELINEONENAME);
            return await TriggerPipelineAsync(pipelineOne, PipelineStatusOptions.StartedPipelineOne, userSettings);
        }
 public DataFactoryController(AppIdealContext db)
        {
            _db = db;
            _client = CreateClientAsync().GetAwaiter().GetResult();
        }

        [HttpPost("TriggerPipelineOne")]
        public async Task<IActionResult> TriggerPipelineOneAsync([FromBody] PipelineOneUserSettingsRequest request)
        {
            var userSettings = ConvertUserSettingsObjectToDictionary(request);
            string pipelineOne = Environment.GetEnvironmentVariable(PIPELINEONENAME);
            return await TriggerPipelineAsync(pipelineOne, PipelineStatusOptions.StartedPipelineOne, userSettings);
        }

When I remove all the async stuff and make it
void
void
etc. then my FromBody works when deployed app in Azure environment. However, with the current code, I keep getting different JSON error messages in the console (even when using the same exact data each time). It seems like it's not getting the full data or something, like it's cut off at different parts, hence the different json error messages. Any ideas?
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

Read body in FromBody and ActionFilter
C#CC# / help
9mo ago
❔ Processes and Async
C#CC# / help
3y ago
❔ Websockets and Async
C#CC# / help
3y ago
❔ WEBAPI [FromBody] Json with optional elements
C#CC# / help
3y ago