Category "asp.net-core"

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

Using eShopOnContainers .NET microservices architecture - Use AD B2C instead of IdentityServer4 for microservice authentication

I have downloaded eShopOnContainers that is a .NET Microservices Sample Reference Application for microservices architecture and Docker containers. https://gith

Turn `ReloadOnChange` off in config source for WebApplicationFactory

This is both a question and an answer. I've fixed my problem, but it seems a bit wrong. My original problem is running my asp.net core integration tests in a b

SqlException (0x80131904): Cannot open database "DBName" requested by the login

I have the following connection string in ASP.NET Core, but I get the following error: Microsoft.Data.SqlClient.SqlException (0x80131904): Cannot open dat

Web Api Return File with additional data

I'm returning a file as follows: public async Task<IActionResult> GetFile(string id) { try { Get