Category "asp.net-core"

Using Asp.Net Core Viewbag

Layout.cshtml @{ var menus = (IEnumerable<WebApplication.Models.TopMenu>)ViewBag.menus; } <div class="col-md-8"> <!-- Menu Partia

Bind custom attribute value to route constraint

How do I bind a custom attribute value to a route? What I want: [ApiController] [CustomAttribute("value")] [Route("{customAttributeValue}/[controller")] public

C# LINQ Filter records in child tables

I have a main table "SALES" and two secondary tables "PRODUCTS" and "SERVICES", I need to select only the records in "SALES" that contain some product or servic

asp.net core binding null in controller post request (list with inside elements lists in view)

I have a view with a list of items that among their properties have a list of items (in View asp.net core). I use a generic list to have common properties that

AppInsights telemetry not co-existing with SeriLog logging

my Program.cs is configured like this using Infrastructure; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Au

i can not pass parameters to backend ( from Ajax to IActionResult or JsonResult) .net core 5

i have problem i can't pass params to backend use fech or ajax call , but from another PC i can pass params, here is a sample from code Backend : [HttpPost]

How can I make my database auto update a column when the date in another column reaches the current date?

I have created a asp net core web application that implements an online system of borrowing books from a library. I have created a table with the following stru

Creating public PASETO token in ASP NET Core

I'm using Paseto.Core Nuget from https://github.com/daviddesmet/paseto-dotnet, and I'm trying to create v4 public PASETO token with this. My code: public async

ASP.NET Core - JsonSerializerOptions.DefaultIgnoreCondition not working for IEnumerable<T>

I've one ASP.NET web app running over .NET Core 3.1 into one AWS Lambda; On Startup.cs I had this configuration: services.AddControllers().AddJsonOptions(opt =&

EF Core/C#: Set many-to-many relationship with a variable field?

If you have an EF/asp.net Core app that has ads with services with a price. Where each ad can have many services (out of a predefined set of choices, like hairc

What is the data type in ASP.NET Core for decimal(18,2) in sql

I have a Amount column in database which is in Varchar datatype, I am retrieving the data from table and I am casting for the amount should be returned as (123

WCF NETCORE ERROR, Unable to create an SSL/TLS secure channel

I'm trying to connect to a Web Service with two-way ssl auth, I've installed the certificates to consume, in the browser in the browser asks me for the certific

I'm using a html.beginform to when i click in a button i go to a diferente Action, but i need to pass the values that i have inside my model aspnet c#

I'm developng a school project using a html.beginform to when i click in a button i go to a diferent Action, but i need to pass the values that i have inside my

WebOptimizer AddLessBundle works in Dev, but not when I publish to Azure

When I publish my core3.1 website to Azure the path to the css files returns a 404 www.mysite.com/css/StyleBundle.css Here is my config. app.UseWebOptimizer();

Difference between HttpContext.TraceIdentifier and Activity.Current.Id

I use a "trace id" in logs. Advice on the aspnet repo and here on SO is to get a traceid from HttpContext.TraceIdentifier. But when the framework creates a Prob

How to get AppSetting values in startup by using services in asp.net core?

I want to get value of appsetting inside StartUp and also using services for saving them. I create a static IServiceCollection method for AddTransient my custom

Why does validation in ASP.NET Core Razor Pages doesn't accept empty inputs?

I am learning how to code in ASP.NET Core Razor Pages and am working on validation right now. Both in client side and server side validation no input is allowed

How to test MassTransit saga state machine with certain state?

I have state machine build with MassTransit: public class OrderStateMachine : MassTransitStateMachine<Order> { public State Completed { get; init; }

ASP.NET Core 6 MVC app custom ExceptionFilter does not catch all exceptions

I have web app with custom exception filter. public class CustomExceptionFilter : ExceptionFilterAttribute { public override void OnException(ExceptionConte

Is there a possibility to set RefreshTokenUsage in oidc client?

i have a problem with my token. when we start our program, the cache should be checked for a valid token. This works for the first time, but afterwards refreshT