Category "asp.net-core"

How to select multiple elements into array in Linq query?

Net core application. I have below query in my application var result = sourceProposal.Quotes .Where(x=>x.QuotationId == sourceQuoteId) .FirstO

Unable to cast object of type 'System.Text.Json.JsonElement' to type 'System.IConvertible'

After converting my application into .NET Core 3.1 , the FromBody json attribute is not working . So Ichanged into [FromBody] JsonElement model. After changin

Is it possible to use a dynamic value in asp-route-{value}?

I have Razor Page with the following piece of code to create a link that adds a dynamic value to the route when clicked. This works perfectly. <a class="page

NLog ApplicationInsights - Instrumentation Key from appsettings.json only loading for TelemetryClient

In my .NET 5 aspnetcore application, NLog is mostly working except for loading the Instrumentation Key from appsettings.json for the logger. It seems to be load

Pass multiple parameter to Ajax from link in MVC Core

I have this link <a asp-action="goPay" asp-route-id="@item.Appid" asp-route-mem="@item.Memid" asp-route-amt="@item.Areq" asp-controller="Withdraw" class="btn

How can I reduce the amount of files produced by dotnet publish command line? [closed]

I tried to publish my dotnet app using dotnet publish --output publish --configuration Release but the result not as expected because the last

AddScheme options not loading from appsettings

I have this line in program.cs builder.Services.AddAuthentication() .AddScheme<SharedSecretAuthenticationOptions, SharedSecretAuthenticationHandler>(S

HttpContext GetEndpoint on modified request path .net 5

I'm trying to create a middleware to handle country code in the url. The code i have works great for removing the country code, so it's routed to the correct en

In Asp.Net Core Can't export traces from OpenTelemetry exporter to elastic apm

Recently, I found OpenTelemetry, and I like to use it in my application. First, I created a new Asp.Net Core 5 web API and exported traces on the console. After

REST Api Design - Opinion on a design choice

I have an API that is connected to a database and where I retrieve data. One schema example: The idea is to retrieve all related data based on the Application

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