Category "asp.net-core"

What to return after Ajax call asp.net

After ajax call is completed and the model is posted successfully to the controller, what should the controller return? In my case, I just want to add an item t

i am receiving an error while returning `<IEnumerable<RiskValue>`.. ASP.NET [closed]

var result = JsonConvert.DeserializeObject<Risks>(jsonData); var finalResult = result.Value.Where(x => x.ID == 5).ToList

RouteBuilder vs EndpointRoutBuilder in .Net

I am trying to learn behind the scene of Routing and I find out that WebApplication implements IEndpointRouteBuilder which allows it to define routes for exampl

Could not load assembly 'CommonBaseData'. Ensure it is referenced by the startup project 'CommonBaseType'

I want create micro service architecture solution so I add some services for my solution. All my services must have one table in my database in there models so

RedirecToAction doesnt call the expected view

I have successfully created a product but the page doesn't redirects to the view I want...and I don't really know why... [HttpPost] public async Task AddProduct

Blazor @page route url define with variable

I have a question for Blazor Server Side. I want to @page route url define with variable or property. I can use now with below default method @page "/route-url"

Why is my file downloading only when I click retry .net core

I'm trying to export data from database to an excel file and then download that file on client side. The export works fine but the problem is with the download

TypeLoadException Method 'IsValid' in type in Pomelo.EntityFrameworkCore.MySql.Update does not have an implementation

When I use Pomelo.EntityFrameworkCore.MySql in combination with Microsoft.AspNetCore.Identity I am getting that error. Are my dependencies wrong ? Similar issue

How to apply filter in child tables using Linq

Net application. I have one entity with child entities. I have to filter based on child entity values. For example in the below query, var sourceProposal = pro

Claims added from Profile service not included in asp.net core 6 Identity with Duende Identity Server

I have below config public static IEnumerable<IdentityResource> GetIdentityResources=> new List<IdentityResource> { new

Visual Studio 2022 ASP.NET Core 6 Default application and Add folder to workspace in Chrome DevTools is not working anymore

After some update to either Visual Studio (I have the same issue in both VS2019 and VS2022) or Chrome I can no longer update the CSS in DevTools and have it ref

Display Multiple Tables In A Single View In ASP.NET Core MVC

I'm working on building a website in ASP.NET Core MVC (the latest version). I have Animals table and Categories table,looking like this: On my AdminController

How to Use Azure Managed Identity as Credential For Debugging Cosmos Database access inside of Blazer Server App?

Background: As described in bullet #4 of my other post I'm trying to follow CDennig's example bicep script to grant my blazor (server) application access to bot

Read action parameters from JSON properties

How can I get the parameters of an ASP.NET Core MVC controller action from the properties of a JSON object that was sent in the HTTP request body? If the reques

How to get Puppeteer-Sharp working on an AWS Elastic Beanstalk running Docker (.NET Core 6)?

I'm looking for an up-to-date example of how to get PuppeteerSharp running on an AWS Elastic Beanstalk instance running Docker (.NET Core 6). There are quite a

how to send array to API which contains image and other data in .net core

When I am passing a single object like below then it is working as per below image [HttpPost] public async Task<ActionResult> Post([FromForm] MyModel Deta

Automapper throwing System.Reflection.AmbiguousMatchException: Ambiguous match found

I have a piece of code that throws exception and I dont quite understand why. public async Task<List<CategoryVm>> Handle(GetCategoriesListQuery re

PostgreSql and EntityFramework Unable to create an object of type

when I am trying to use this command dotnet ef migrations add InitialCreate I am getting error like : Unable to create an object of type 'BlogDbContext'. For th

NET 5 and EF: how to use AddPooledDbContextFactory in liu of DbContext in services

I recently came across AddPooledDbContextFactory concept as part of my NET 5 self-education piece and am keen to implement it properly. However, I am not sure h

Binding section from appsettings.json to options

So I was trying to follow the Microsoft Docs, Options pattern in ASP.NET Core however for the life of me I can't seem to correctly get the "AppSettings" section