Category "asp.net-core"

Can't resolve symbol "FirstOrDefaultAsync" in .Net Core Web API

I'm building a .Net Core Web API and in one of the files the FirstOrDefaultAsync() method just doesn't work although I'm using it in various files in the same p

Change request Content-Type to allow invalid/unsupported request Content-Types

A client is currently sending our ASP.NET 4.x/Core REST APIs the correct request payload but invalid request Content-Type which is resulting in 415 status codes

How to prevent HttpClient.SendAsync Method from sending duplicate data

Is there away to prevent HttpClient.SendAsync method from sending duplicate data. For context purpose am getting data from one API and posting to another API I

MiniProfiler dynamic response handling in .NET 6

Recently I have integrated MiniProfiler into a .NET 6 API and all works well, can see the SQL queries via EFCore and all on the dashboard. What I would like to

What value should I return in catch?

I just implemented a Try catch in my code, the error is because I have to return something in the catch, I can't understand is "what should I return?" 'Company

Add property to all responses in asp.net core

I have an API with multiple endpoints. I'd like to add a property to all endpoint responses, without adding it to each endpoint response model individually. Ex:

c# Microsoft Graph permissions to read mails

I have the following list of permissions on Azure AD: my ASP.NET Web Core app has the following config: { "AzureAd": { "Instance": "https://login.microso

XmlException and CryptographicException when running blazor web server app

I receive these two exceptions when I run my blazor web server app: XmlException: Root element is missing. CryptographicException: An error occurred while tryin

Xamarin - Shell.Current.GoToAsync($"//...") performance too slow on Android

I have a Xamarin project and I'm using visual studio 2019. I consume an API to access data and for my LoginPage flow I used routing in shell. So here is my AppS

Deserialize array that was Serialized with BinaryFormatter, without using BinaryFormatter to deserialize

BinaryFormatter is now obsolete for security reasons. Unfortunately, there is a ton of old legacy records that were serialized to array using the BinaryFormatte

Deserialize array that was Serialized with BinaryFormatter, without using BinaryFormatter to deserialize

BinaryFormatter is now obsolete for security reasons. Unfortunately, there is a ton of old legacy records that were serialized to array using the BinaryFormatte

ASP NET Core 6 MVC Slow page loading

I am trying to upgrade an old ASP .NET project from Framework 4.5 to Core .NET 6. Going well so far, but I noticed the page loading was way longer than before.

How Can I Force .Net Core To Send Email Using Expired Certificate?

My ASP.Net Core website won't send email due to an error on the email server. The error appears to be due to AutoSSL issuing certificates that already expired a

Fluent Validation with conditions in asp.net core

I am working in asp. net core 6.0 web API project (clean architecture (CQRS)). I am using fluent validation for validate command and queries. public class Creat

Razorpages Post new record and return to page with updated Id

Using Net6.0 Razorpages, I have a form that returns a Person by Id, and allows the user to update the record or add a new Person OnPost. When posting a new reco

Audit.Net: Audit Record Not Rolling Back When saving master record throws DbUpdateException

I have been using Audit.EntityFramework.Core v14.6.3 in my .Net Core v2.2 Web API. When I update a table record, it threw dbUpdateException error due to a check

Validation occurs even Data Anotations is not set

I am working on dot net core 3.1.I have a form for submitting product details. I have used Data annotations with jquery validations. My problem is when I try to

unable to send an email after deployment of website using asp.net mvc 5

I am trying to send an email using asp.net MVC 5 I use the number of repositories for email it's working on local but after deployment, it's not working where I

How do I capture the data sent by ajax in asp.net razor page?

I'm trying to populate a partial view with the data of the user i clicked on. Here is the code: <tbody class="text-center "> @foreach

Request is missing required authentication credential. Expected OAuth 2 accesstoken, login cookie or other valid authentication credential(Googleads)

I am trying to migrate Adwords API(sunset on 27th April, 2022) to Google Ads api. Using Asp.Net Core(5.0) and c#. Exception: Google.Ads.GoogleAds.V10.Errors.Goo