Category "asp.net-core"

ASP.Net core - blank response when returning a JObject property

I am using ASP.Net core 5.0 and want to return IEnumerable of an object as Action method response. Here is the response class: public class TestResponse { p

Why use AddScoped() instead of AddSingleton()?

Why I should use AddScoped() for my repositories or services? Why not AddSingleton()? I know about differences between them, but dont understand why I shouldn't

Posting form file to ASP .NET Core API using AWS SDK Test Lambda Context and APIGatewayProxyRequest

I have an ASP .NET Core API endpoint which accepts the below model: public class FileUploadModel { public IFormFile? File { get; set; } public DateTime?

NET Core 3.1 MVC Authorization/Authentication with token (JWT) obtained externally in separate Net Core 3.1 Web Api

I have 3 projects: Net Core 3.1 MVC project. Net Core 3.1 Web Api project with JWT auth --> connected to db via Entity Framework (Xamarin app that also uses

Asp.Net Core : Get the value after siding in DbContext?

I want to seed a default value in the database...These values ​​include a role and a user. How can I take the role value after seed and add it to th

Error CS0234 The type or namespace name 'HttpContext' does not exist in the namespace 'System.Web' in asp.net core

CS0234 The type or namespace name 'Http Context' does not exist in the namespace 'System Web' in asp.net core

filter data in header based on API key authentication

I want to try to filter data based on API key authentication using NET CORE where the key is stored in the header. each key has its own data. is there a refere

how to use ILogger when using global ActionFilter

i have an action filter where i am trying to log name of action that system enters and left. public class LogFilter : IAsyncActionFilter {

HttpContext.SignInAsync() doesn't authenticate the user

I have been trying to create a custom login feature in ASP.NET Core 2.1. However, it doesn't seem the work and I have no idea why. This is run in the controlle

Connect to Azure Service Bus with Amqp over WebSockets using new Standard library

I am trying to send a message to my queue hosted in azure. My application communicates with the world through a proxy. I use the .Net Core 2.1 and the new the

How to test a .NET 4.8 client running against a .NET 5.0 server in a developer-friendly way?

I don't know if this question is appropriate for this forum. I am developing a C# ASP.NET Core webservice and a client-side library that uses this webservice. A

Why is web.config getting created on publish not on build the project in Asp.Net Core API?

I have Asp.net Core 3.1 API project. When I build it doesn't create any web.config file, but when I publish the API using VS 2019 in a folder, it creates a web.

EF Core - generic way to merge child records based on current db state and equality

I have a scenario where during an Update request of a parent entity, I have a collection of children entities in my dto, and want to merge them in the DB so tha

How to generate heap overflow error using c#

I want generate a heap overflow error and slow down the system, however I have created alot of objects on class level, later on creating that class object milli

Awaiting localhost to reload in ASP.NET Core

I have an ASP.NET Core server, which is using SignalR to generate HTML pages dynamically at runtime through JavaScript. After i shut my application down, in the

How to add bearer token authentication to typed HttpClient in Asp.Net Core 6

I'm trying to setup a web api using ASP.Net Core 6 so that users can hit my end points and then I do some work in D365 behind the scenes using a privileged acco

Unable to Deserialize HttpResponseMessage to Model Object

Code for Getting the Response: public async Task<List<RepositoryListResponseItem>> MakeGitRequestAsync<T>(string url) { List<Repositor

How to use "Azure storage blobs" for POST method in controller

I am creating an app where user can upload their text file and find out about its most used word. I have tried to follow this doc to get used to the idea of us

How to create Product Attribute Combination in asp.net core?

Product Name Color Size T Shirt Red Small Pant Yellow Large Green Desired results: T Shirt Red Small T Shirt Red Large T Shirt Yellow Small T Shirt Yellow

Microservice architecture Database rollback

I am having a microserice architecture with multiple services, each containing their own Database, and a Gateway which is considered as the business logic. Gat