37,950 questions
0
votes
1
answer
49
views
Registering the container itself with Autofac does not work in ASP.NET Web API on .NET 4.7.2
The following does not work for me:
IContainer container;
ContainerBuilder builder = new ContainerBuilder();
container = builder.Build();
builder.RegisterInstance(container).As<IContainer>();
...
0
votes
1
answer
196
views
problem with direct print stimulsoft report on printers in local iis
I have an asp.net core web API, I want to print reports directly to the local printer in Stimulsoft Report (without preview) when call my api, my code is :
StiReport rpt = new StiReport() { ...
1
vote
1
answer
36
views
Merging File Upload and Template Creation Messages in ASP.NET Web API with RabbitMQ
I am developing an application using ASP.NET Web API and Angular with two main functionalities:
File Upload:
Users can upload files, and upon successful upload, the server generates URLs for these ...
0
votes
1
answer
74
views
Square brackets around response JSON in Web API
I have built a C# Web API using Swagger. It's up and running at this link: https://www.vijilcomm.com/api/swagger/index.html.
When I hit it, for example like so:
https://www.vijilcomm.com/api/...
0
votes
0
answers
40
views
Cant run EntityFrameWork on Docker-compose using Asp.net api
I'm trying to run a .NET API with MySQL as the database, using Entity Framework to set up the database (so from API -> MySQL migrations).
The API seems to run well, and I think MySQL is also ...
0
votes
1
answer
176
views
How do I solve Inconsistent accessibility parameter in ASP .NET Integration testing?
I am trying to make clean integration tests for ASP .NET WebApi.
This is the webapplication factory class.
The program class its using in the extend is an internal from the API project. (Done with ...
0
votes
1
answer
142
views
I can't connect ASP.NET Web API with .NET Maui
I want to connect my first maui test app with ASP.NET Web API that retrieves data from mongoDB. When the ASP.NET Web API is running, I can easily retrieve my data from Swagger UI, but when it comes to ...
-1
votes
3
answers
86
views
Unable to delete Employee record using LINQ
I am trying to delete a record from Employee table based on EmpId which is the primary key (EmpId is also a foreign key for table Salary) using LINQ in asp.net web Api. But I am getting an error which ...
0
votes
2
answers
68
views
LINQ Expressions in xUnit test
How can I simulate this part of my code in xUnit
var updateCost =
await _costOfConsomption.DeferredWhere(x => x.Id == model.CostOfConsomptionId).FirstOrDefaultAsync() ??
...
0
votes
0
answers
26
views
ActionFilter to limit api exection time for configure time only. What is wrong with this implementation
public class TimeoutAttribute : ActionFilterAttribute
{
private readonly int _timeoutInMilliseconds;
private readonly TimeSpan _timeout;
public TimeoutAttribute(int timeoutInMilliseconds)
...
-1
votes
1
answer
488
views
DeepL API - I am using DeepL .net API for document translation - getting error while translating large file [closed]
I have implemented translator using DeepL DotNet API.I am having DeepL Pro account.
I have implemented .net framework web api where I am using deepl Pro account for translation. I am using my web api ...
0
votes
2
answers
243
views
FormData parameter is always null in endpoint when passing a collection of IFormFile
The following CreateImages endpoint is in my C# .NET Web API. Testing with Postman and Swagger UI, when I upload files and send the request, files parameter below is always null. I don't have this ...
0
votes
1
answer
137
views
A non-blocking socket operation could not be completed immediately
private void DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
{
SocketsTelemetry.Log.ConnectStart(socketAddress);
SocketError errorCode;
try
{
errorCode = ...
-1
votes
1
answer
43
views
I want to view selected data in cascading dropdown in .NET Core
I have creation page of cascading dropdown that value store in database. This "Save" operation works ok. But while fetching the data from the database, it is not getting selected accordingly....
0
votes
1
answer
74
views
Wildcard route for ASP.NET Web API
In our ASP.NET Web API project written in C#, we need to route the below endpoints to a single action method with WildCard route in the API:
http://mycomparydomain.com/api/records/recordsearch?...
0
votes
1
answer
64
views
Crystal report A6 print issue in IIS
I have designed crystal report which needs to be print in A6 paper in visual studio 2019, from local host it is printing fine, but after deployment in IIS it is not printing properly. Could any one ...
1
vote
1
answer
79
views
How do I use ValidationAttribute or IModelBinder to ensure that an enum property exists in the JSON body and has a valid value?
Given a model that looks like this:
public enum Types
{
Emergency,
Notice,
Event
}
public class Message
{
public Types Type { get; set; }
public string Title { get; set; }
}
And ...
5
votes
1
answer
571
views
FastEndPoints swagger endpoint grouping name lower case issue
I'm using fastendpoints for my latest project. In designing endpoints I face following issue.
just note that simple case in substring "Roles".
Here is how I configure the endpoint
Does ...
0
votes
0
answers
65
views
Execute 'logout' method when closing chrome
I'm working on a chat support system and I need to keep the current status and the time that the user has been logged to that status even when the user navigate through different pages or refresh the ...
1
vote
1
answer
423
views
Data annotations not recognized by Entity Framework Core in one ASP.NET project but work properly in another
I am using Entity Framework Core 3.1 with a "code-first" approach for 2 ASP.NET projects on .NET 4.8. "Code first" is in quotes because this is really a migration from EF 6 where ...
0
votes
0
answers
42
views
What is OWIN default user and password
I just created default WebApi project in Visual Studio which uses OWIN for authentication. What is its default user password as I need to get bearer token?
I also disabled OWIN from web.config by ...
1
vote
0
answers
114
views
Is it possible to configure EF and SQL Server to use with JOB Queue in FastEndpoints
Was trying to use Job Queue background scheduled task with FastEndpoint it seems ok with SQlite and LiteDb but could not quick get it working with EF and SQL Server, is there any sample code I can ...
1
vote
2
answers
98
views
How to add role parameter in my response body?
When I Login I cannot add role parameter in my response body.
This is my current response body
{ "tokenType": "string", "accessToken": "string", "expiresIn&...
0
votes
1
answer
272
views
CORS failed: The Same-Origin Policy disallows reading the remote resource
I keep getting the following error in Firefox:
Cross-Origin Request Blocked: The Same-Origin Policy disallows reading the remote resource at http://192.168.0.146:5000/api/auth/login. (Reason: CORS ...
2
votes
0
answers
603
views
ASP.NET Core 8.0 SignalR: Successful Connection but No Notifications Received in Client
I am working on an ASP.NET Core 8.0 Web API application and I'm trying to implement SignalR for real-time notifications for the first time. Despite successfully connecting to the SignalR hub, I am ...