How to nicely solve self-referencing object update error?
In my project I have a bunch of models, that are all derived from the class 'Entity'. Simplified, this means they all have the following properties: public Guid Id { get; set; } public DateTime Created { get; set; } public required User CreatedBy { get;…
Question/Suggestions on using a Windows Service or Hangfire
I plan on either doing a Windows Service, or using Hangfire (right in my web api), for continuously gathering new security event logs similar to that of the Windows Event Viewer. Looking for feedback/suggestions on doing it with an event listener. What…
Fetch data for a specific field in Web API C#
Hello, I have a Json URI which I am using as a data source. I am writing a web api wherein I need to retrieve the data for any of the specific field which user inputs. For e.g, below json is my data source and I need to fetch data only for table_no. So…
Asp.net api Endpoint, IAsyncEnumerable stream being buffered
Hello, I'm using .net 7, http://asp.net core api w/controllers and I"ve tried with minimal api on VS 2022. Using c# to stream using IAsyncEnumerable some simple text line by line. Ive tried a simple obj. Ive tried ints. No matter what I've tried the…
How to fix "Register the constraint type with 'Microsoft.AspNetCore.Routing.RouteOptions.ConstraintMap"?
Hello! I know this question has several posts with multiple answers but in my case I haven't found the solution. I'm building a Web Api with NET 8 My Web Api has swagger I'm using Dependency Injection, Service layer, UnityOfWork and Repository…
How can i use signInManager in MVC project without using dbcontext and instead communicate with ASP.NET API
So i have a question when i made a MVC project i used signInManager to sign in and also to check identity by checking his role to see if he is a user or admin and it worked with me but my question is how to use it with API + MVC i have made API and…
Can you use an array inside of .Contains() via LINQ?
Please see the very bottom in the Answers section from me, I updated question down there rather than removing this here. A co-worker and myself wrote a very small app to store logs in a SQL database for 6 months. I'd like to add filtering parameters to…
rate limit in web api
Is there any way to implement rate limiting of web apis in .Net framework 4.x? There seems to be packages in latest .net versions as well as .net core. However looking for one for the .net framework
How to select Manage NuGet Packages from VS Code
Working state: MS Learn --> PL-400 --> Introduction to developing with Microsoft Power Platform --> Introduction to extending Power Platform --> Exercise - Create a custom API --> Step 13 - "Right click on the CustomAPILab Project…
WSDiscovery 'Hello' message isn't recognised by dasHost.exe
I'm trying to use WSDiscovery in .Net8. This isn't supported directly but I have got a client application working that is able to send probe requests and receives probematch replies from dasHost.exe However I can't manage to get my server application to…
How to fix update problem in concurrent request in ASP.NET Web API 2
I am working on an ASP.NET Web API 2 project with .NET Framework 4.6.2. When I send two concurrent requests with the same parameters from Postman, only one record is updated in the database, even though there should be two. I have included screenshots of…
Is it possible to add delay to concurrent requests in ASP.NET Web API 2?
I am using WebApiThrottle for rate limiting in my ASP.NET Web API 2 project, but I am having problems with concurrent requests. Instead of sending 429 too many requests responses, is it possible to delay concurrent requests, for example, allowing only…
Retroactivly scaffolding identity into both my backend and frontend so that it all works
Hello! I've made 3 projects in my solution. one is my Api project, one is my blazor project and one is a class library for my Dtos. Both my backend and frontend reference the class library. I wanna retroactivly scaffold identity into my backend…
Connection to API using FrameWork 4.8
Good morning, I'm trying to connect to an API, but the example provided uses .net 6.0, but my project is using FrameWork 4.8, for example, I don't have the Text.Json library and I believe I'll need another one to get the answer. request.Content = new…
Web API on dependency injection
How can I check if a record exists in the database before performing operations like editing or deleting it in a .NET Core Web API, considering the requirement to add a private method for this purpose?
.Net Core web API
How can I integrate Swagger or OpenAPI documentation into a .NET Core Web API, and what advantages does it offer in terms of documenting and testing API endpoints?
Error passing JSON to API
I'm transforming a vb.net class into a JsonSerializer.Serialize and after trying to integrate with an APi it presents an error not finding the client. I did a test and went straight to HttpRequestMessage request.Content = New…
Implementing Windows Authentication in Web Api using .Net 4.8 (Not Core)
I have an existing Web Api project build with .Net 4.8. In production, I have both Web Api and Angular based web site deployed in IIS in Windows 2022. The database, SQL Server 2017, is running on separate Windows 2022 machine. Both servers are in same…
How to register two classes that inherit from IdentityUser with different DbContexts (.net 6 web api)
I want to use builder.Services.AddIdentity() as follows: Both User and Employee classes inherit from IdentityUser. AppDbContext and EmployeeDbContext inherit from IdentityDbContext. As you might have guessed, Users and Employees are stored in different…
Web API Development Using Client Credential and Auth Code
Good Morning, I am trying to architect a Web API solution that involves potentially, a user facing web interface that offers functionality to non-registered users, as well as registered users. This would define two scopes within the application; the…