Category ".net-core"

.NET Core Entity Framework how to map nested class into one sql table

I'm still new to .NET Core. I have this character that I want to store in SQLite using an entity. But by default, Character, CharacterData and CharacterLine are

How to configure IIS to define Client Certificate required on a specific endpoint when routing make endpoint path different from physical path

I implemented a dotnet core Api where endpoints are defined based on the Controller attribute Route. I have for example 2 endpoints api/controller1 and api/cont

load .so file use fullPath fail with dotnet3.1 on centos7

I use dotnetcore 3.1 Pinvoke to call my .so file,but it can't be load.I used myLibraryFullPath to load it.What can i do to load this .so file? i can post image,

Get .NET Core JsonSerializer to serialize private members

I have a class with a private List<T> property which I would like to serialize/deserialize using the JsonSerializer. Use of the JsonPropertyAttribute does

Database operation expected to affect 1 row(s) but actually affected 0 row(s) entity framework core

I have the following code try { using (var context = await PrepareDatabase()) { // Update temp roles by removing one row, this

EF Core one-one relationships

I need to configure following one-one relationship with ef-core public class Player { public long Id { get; set; } public string Name { get; set; }

Is there another way to view a PDF file from dotnet core API with react

I have dotnet core API thats returning a downloadable and i want my react to view as a blob but the pdf that is getting rendered is blank Dotnet core code

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

System.Configuration.ConfigurationManager vs Microsoft.Extensions.Configuration

I am working on a class library(.NET Standard 2.0) CL, which will be used by some of our legacy projects(.NET Framework 4.6.1) LP and many of our new implementa

Should I take ILogger, ILogger<T>, ILoggerFactory or ILoggerProvider for a library?

This may be somewhat related to Pass ILogger or ILoggerFactory to constructors in AspNet Core?, however this is specifically about Library Design, not about how

Does the latest version of System.Data.Sqlite not support password encryption?

I've got a .Net Core appl and am using the System.Data.SQLite.dll package to connect to a SQLite DB. I'm trying to encrypt the database with a password. In vers

ASP.NET Core YARP Reverse Proxy multiple listen ports

I want to Reverse Proxy multiple ports, with YARP. 0.0.0.0:5001 => RemoteHost.com:7001 0.0.0.0:5002 => RemoteHost.com:7002 0.0.0.0:5003 => Remote

How do I solve SqlNullValueException?

I'm trying to find an entity but I get a SqlNullValueException when entity framework is trying to get the value of a field that's Null. I checked in the databa

Application insights | Sometimes End-to-end transaction details do not show all telemetry

I have .Net core App deployed on azure and enabled application insights. Sometimes Azure application insights End-to-end transaction details do not display all

How can I log messages from an ASP.NET Core application to a specific file on Linux?

I installed an ASP.NET Core application as a Linux daemon. By default .NET writes logs into /var/log/message but I would like the application to write its logs

Access IHost across application classes globally

Below is an example code for CreateHostBuilder. Asp.net core host takes care of resolving dependency through constructor and middleware. If we want to resolve

Button Click to return to the same page with same input parameters

I want users to navigate back to the same page after the button is clicked on the page. If the user URL is https://localhost:xxx/Inventories/Index/38?custID=38&

How to declare global variable in Program cs and use it in controllers in .NET 6.0 Web Api

I have default Program.cs file from Web Api template in .NET 6.0. I am adding variable "test" so I can use its value in controllers. var builder = WebApplicatio

How to declare global variable in Program cs and use it in controllers in .NET 6.0 Web Api

I have default Program.cs file from Web Api template in .NET 6.0. I am adding variable "test" so I can use its value in controllers. var builder = WebApplicatio

.net Core 3.0, DirectoryNotFoundException with Xunit Integration test

I have a new issue working on migrating my Xunit integration test on .net core 3.0. I moved the project in a subfolder and now I have a DirectoryNotFoundExcepti