Skip to main content

All Questions

Tagged with
0 votes
1 answer
78 views

Should the SqlConnection Be a Class Field or Should I Pass It In and Out Of Functions As Needed?

I am writing a C# Database connection class and I am trying to adhere to best practices and produce clean code. In the CreateAndOpenDatabaseConnection function ...
BeeFriedman's user avatar
0 votes
1 answer
77 views

EF Core code-first "many-to-many-to-many" (Books with many credits with many people)

Let's say you have a book. A book can have an author, an editor, a proof reader, or several other credits. Which credits are available should be dynamic (someone might not want to have the "proof ...
TheHvidsten's user avatar
1 vote
1 answer
136 views

Creating database and two tables linked by foreign key

These commands do what I want, but I'm trying to find out the best approach for this. My main areas of concern are: error handling and disposal of resources. In regards to error handling, I'm catching ...
Pablo Aguirre de Souza's user avatar
0 votes
1 answer
80 views

Properly implementing HasChanges pattern for model

There is the following method that should get record from the database, apply new data, and if at least one value has been changed, update database and send event We don't use EntityFramework, it uses ...
Roman Marusyk's user avatar
1 vote
2 answers
718 views

Database dynamic query

I am working with C#, Npgsql, EF Core and Postgres. I ...
Emaborsa's user avatar
  • 193
3 votes
1 answer
86 views

Filtering database with Linq

I'm building an MVC web app with ASP.CORE 3.1 and EF connected to MSSQL. Today, finally after 3 days, I've somewhat reached a working code for filtering my view. I've got database of Date stamps (15 ...
Son Goku ssj4's user avatar
3 votes
0 answers
63 views

SQL database implementation - statement execution

This is another class from my implementation of SQL in C#. It handles the execution of SQL statements, with the core method looking like this: ...
George Barwood's user avatar
2 votes
1 answer
157 views

Fully buffered stream with atomic commit

This is a class from an implementation of SQL in C# I am writing. It fully buffers all reads and writes, and also logs changes to a log file so that updates are atomic ( all or nothing ). It ...
George Barwood's user avatar
0 votes
0 answers
84 views

Entity Framework optimization when using transactions

I want to save NUnit local tests in a mysql database hosted in Amazon RDS, and I'm wrapping up everything in a transaction like so : ...
mark02's user avatar
  • 9
2 votes
0 answers
59 views

Sharing model for different ORM's

I am building a MySQL to Realmdb converter app. I use Entity Framework to deal with MySQL, so below is the code of one of my model classes. I don't want to have multiple classes representing the same ...
Movsar Bekaev's user avatar
2 votes
1 answer
2k views

DataReader to To IEnumerable<object[]> To 2 Dimensional Array

Let me preface this with a few things before I get into my question: I am making the leap from VBA/VB6 to .NET, (boy is it a big one), so I am noob to .NET best ...
ARickman's user avatar
  • 678
8 votes
2 answers
228 views

Non-Entity framework database interaction model

A C# WPF user interface has been developed for the Book Inventory MySQL database previously shown in this question. Since the database had already been developed this was a database first ...
pacmaninbw's user avatar
  • 25.7k
1 vote
1 answer
161 views

Asynchronous wrapper for database connection

I'm using a database that has a library for access to it. Connection is done synchronously, it's blocking and I do not have a way to abort it. To connect, I have to write: ...
Loreno's user avatar
  • 143
-1 votes
1 answer
132 views

Handling Entity Framework in connected mode within Windows Forms [closed]

I know the difference between the Entity Framework connected mode vs disconnected mode. In connected mode we do all the stuff inside one single DbContext instance. ...
Ahmed Suror's user avatar
4 votes
0 answers
1k views

Generic Unit of Work implementation

I am implementing the unit of work pattern to be used in the logic layer of my application. The goal is to abstract away the tasks of managing transactions / connections. My implementation relies ...
Tagor's user avatar
  • 141

15 30 50 per page
1
2 3 4 5
7