Skip to main content
1 vote
0 answers
61 views

I have an ASP.NET Core 8 app with a long-lived service that refreshes an in-memory cache on a timer. I registered the service as a singleton (it’s a hosted background worker), and it needs to query ...
Michael Ding's user avatar
0 votes
1 answer
94 views

I am using EF 6 DbContext.Database.Exists() method, i.e. its return value true/false, to detect if a given DB is available. If it is, I pull and process data, if not, I enter a message into the log ...
user2217057's user avatar
2 votes
1 answer
83 views

I am using .NET 8 and Oracle EF Core. In my application, I need to use both AddDbContext<MyDbContext>() for normal per-request operations and AddPooledDbContextFactory<MyDbContext>() for ...
Onur Yukay's user avatar
1 vote
1 answer
45 views

I have this query in SQL: SELECT c.CompanyName, ( SELECT TOP 1 ct.CompanyTypeID FROM CompanyType AS ct WHERE ct.CompanyID=c....
Xiao Han's user avatar
  • 1,078
1 vote
0 answers
82 views

I am creating a library for our department to access multiple resources. Each resource type is in its own project inside the large solution. Each project will be built into its own NuGet package and ...
Benjamin Kleynhans's user avatar
0 votes
0 answers
65 views

I get this exception: The entity type 'TblCentrale' requires a primary key to be defined. If you intended to use a keyless entity type, call 'HasNoKey' in 'OnModelCreating'. This is the code in ...
Eric Ouellet's user avatar
0 votes
1 answer
78 views

When I implement an ASP.NET Core application, I may have several middlewares that must interact with the database in order to check something. All of them, and also the final endpoint, share a scoped ...
Massimiliano Kraus's user avatar
0 votes
0 answers
61 views

I've run into a sticky little problem with my Visual Studio 2022 Web API test project. All of tests run successfully separately (one at a time), but when I try to run them all together (bulk) I get ...
wloescher's user avatar
  • 4,613
0 votes
0 answers
71 views

I am trying to use TransactionScope to make my db context operations spread across different files run under one transaction, so all or none save should happen. The problem is it is giving me this ...
Pawan Nogariya's user avatar
0 votes
2 answers
77 views

I decided to add models to work with the database. That's how it was and working public sealed class DatabaseContext : DbContext { public DbSet<Payment> Payments { get; set; } = null!; I ...
amg63's user avatar
  • 25
0 votes
0 answers
66 views

In my ASP.NET MVC project (written in C#), I want to use the right DbContext according some value from some condition. That DbContext should be available for all the methods of the controller. To do ...
Pspl's user avatar
  • 1,474
0 votes
0 answers
43 views

I'm having some issues with Entity Framework on .NET Framework. My app is designed as such: I have my class that inherits from DbContext and I have this property: public DbSet<User> Users { get; ...
Alberto's user avatar
  • 58
1 vote
1 answer
178 views

In my company, we have a system with the following structure: Moldable hosts: servers are defined by their IP addresses Moldable databases: each database is created based on a country code Company-...
BrePi's user avatar
  • 49
0 votes
1 answer
92 views

My app receives multiple files (50 files, each file with 1000 rows) and processes them in Dataflow blocks. In one of the blocks UploadToDatabaseBlock, I set MaxDegreeOfParalellism to 8. This creates ...
Mihai Socaciu's user avatar
0 votes
1 answer
77 views

Ok, so back in the day we used the ADO and created entities, but now that Visual Studio Pro 2009 won't work with .NET 8 anymore, it seems to be the target for today's era. Anyways besides that I had a ...
Dave2022's user avatar

15 30 50 per page
1
2 3 4 5
173