Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
27 votes
Accepted

What are the differences between .NET Framework, ASP.NET, .NET Core, ASP.NET Core and .NET Standard?

.NET Framework is a VM, a JIT compiler, an object memory system consisting of a memory allocator and a garbage collector, a loader, a linker, and a runtime system (collectively called the Common ...
Jörg W Mittag's user avatar
25 votes
Accepted

ASP.NET Projects using too much .NET Boilerplate Libraries / Code

When you start a project and have a particular need, you have a choice: Either you implement your own solution from scratch, Or you use an existent library or framework. When implementing your own ...
Arseni Mourzenko's user avatar
23 votes
Accepted

Isn't CQRS overengineering?

Is CQRS a relatively complicated and costly pattern ? Yes. Is it over-engineering ? Absolutely not. In the original article where Martin Fowler talks about CQRS you can see a lot of warnings about not ...
Machado's user avatar
  • 4,120
23 votes
Accepted

What data should a repository return

And knowing (correct me if I'm wrong) that a repository shouldn't return a DTO Theoretically, every layer (= project in your solution) should have its own DTO objects. In that sense, your ...
Flater's user avatar
  • 51.7k
22 votes
Accepted

Why would anyone use multipart/form-data for mixed data and file transfers?

multipart/form-data is a construct created for HTML forms. As you've discovered the positive of multipart/form-data is the transfer size is closer to the size of the object being transferred--where in ...
Samuel's user avatar
  • 9,197
21 votes
Accepted

Why do Microsoft's libraries depend on Newtonsoft.Json?

The most direct quote I've found is part of Scott Guthrie's announcement of the MVC 4 roadmap, back in 2012, (apparently offline but available via the Wayback Machine) which contains the following ...
Avner Shahar-Kashtan's user avatar
21 votes
Accepted

Is CQRS/MediatR worth it when developing an ASP.NET application?

I think you're expecting too much of the pattern you're using. CQRS is specifically designed to address the difference in model between query and commands to the database, and MediatR is just in-...
Samuel's user avatar
  • 9,197
15 votes

Should I check for software on a users machine via a web browser?

You cannot check through a browser if the user have other software like Word installed. If that was possible it would be a huge security hole.
JacquesB's user avatar
  • 59.7k
14 votes
Accepted

Where to put the Angular app in a ASP.NET Web API solution?

You have two options. Create separate mywebsite.api and a mywebsite.app projects in your solution. Advantages Proper separation of concerns. You can deploy updates to your api and your front end ...
CountZero's user avatar
  • 256
12 votes

Can a caller abort an execution of code invoked by HTTP request?

HTTP doesn't work like that. The client sends a request, then the server sends a response back. No other communication occurs. Well, the server can send 1xx informational responses before the main ...
amon's user avatar
  • 134k
11 votes

Time zone conversions on back-end or front-end

The general rules is 'Always send date times as UTC' and only convert on the presentation layer. However, javascript is rubbish with datetimes. So I would do the required conversion server side and ...
Ewan's user avatar
  • 76.3k
11 votes
Accepted

why controller lifetime is transient by default in asp.net core?

There's a number of advantages to transient controllers. I cannot tell you whether any of them were the reason they were done that way - speculating about the intent of designers does not make a good ...
Sebastian Redl's user avatar
11 votes

Is it a bad practice to use Singleton for DI in Asp.net rather than Scoped, Transient whenever possible?

Is it a bad practice to use X whenever possible? Yes. It is bad practice to turn off your brain and lean on absolutes. It's far better to understand why. So lets step back from that framework and try ...
candied_orange's user avatar
10 votes

Is CQRS/MediatR worth it when developing an ASP.NET application?

CQRS is more of a data management thing rather than and doesn't tend to bleed too heavily into an application layer (or Domain if you prefer, as it tends to be most often used in DDD systems). Your ...
jleach's user avatar
  • 2,682
10 votes
Accepted

Application_Start() vs ApplicationStart()

This is an event handler, in addition to being a method. The convention for naming event handlers is EventOrigin_EventName(...). Event origin can be a name of an instance (camel case), or a name of a ...
Nick Alexeev's user avatar
  • 2,512
10 votes
Accepted

Why is it bad to map between a Model and a ViewModel in an extension method

It isn't how extension methods are supposed to be used, it is not in the spirit of extension methods. I'm going to hard counter that notion, because it is exactly the spirit of extension methods. ...
Flater's user avatar
  • 51.7k
9 votes

Utility Classes in MVC - ASP.NET

None of the answers previously given address the actual question. user60812 simply asked where one would place a utility class inside of an MVC project. Everyone harked on the singular example and ...
Spencer Sullivan's user avatar
9 votes

How Common/Acceptable is it for a .NET developer to abstain from WebForms as a rule?

My observation is that WebForms is on the decline. There is a good reason for that. Having used WebForms extensively in the past, it's difficult to do something outside the box. In addition to the ...
Kasey Speakman's user avatar
8 votes
Accepted

Migrate business logic from database into the business layer (.NET technology)

Be careful! If I understand you correctly, what you describe is going to be a lot slower. Aggregate operations like Sum, Avg etc. is pretty fast if you run them in SQL. They will only be slow if ...
JacquesB's user avatar
  • 59.7k
8 votes

Colleague wants web apps to behave like Windows desktop programs

User expectations should be taken into account when developing software but users are bad sources of UX/UI specifications. You need to have (or be) a UX/UI designer to design a UI that fulfills the ...
Hans-Martin Mosner's user avatar
8 votes

Is it a bad practice to use Singleton for DI in Asp.net rather than Scoped, Transient whenever possible?

Firstly, you are confusing singletons provided by a DI container with the "Gang of Four" singleton pattern. The latter is a glorified global variable and thus a complete anti-pattern and ...
David Arno's user avatar
  • 39.3k
8 votes

Is it a bad practice to use Singleton for DI in Asp.net rather than Scoped, Transient whenever possible?

Before you change whether a service is Transient, Scoped, or Singleton, do make sure you are not introducing bugs. When something is designed to be thrown away quickly, there might be assumptions ...
Berin Loritsch's user avatar
7 votes
Accepted

Best Practice for masking Credit Card informations in Web Api 2

"We're logging every http request and response with log4Net." Although im sure this is very useful for developers, its very bad practice and is potentialy illegal. As you have pointed out you are ...
Ewan's user avatar
  • 76.3k
7 votes

Is CQRS/MediatR worth it when developing an ASP.NET application?

I highly recommend you view Jimmy Bogard's NDC presentation on his approach to modelling http requests https://www.youtube.com/watch?v=SUiWfhAhgQw You will then get a clear idea of what Mediatr is ...
DavidRogersDev's user avatar
7 votes

ASP.NET Projects using too much .NET Boilerplate Libraries / Code

Yes, most places I've worked at use some of those libraries. It is tempting to see them as bloat, I for one dislike Entity Framework and tend to 'hand crank' my repositories. But, in fact the ...
Ewan's user avatar
  • 76.3k
7 votes
Accepted

At what point does a microservices architecture become "worth it" vs. a monolithic ASP.NET web application?

As I see it, the size of the application doesn't really have much to do with the microservices pattern. After all, you can always choose to build a few large monoliths or to build a monolith out of ...
Michael's user avatar
  • 6,467
7 votes
Accepted

Is there a library or algorithm I can use to solve this type of problem efficiently in C# (.NET Core 3.0)?

Unfortunately, this is known as a Set Cover problem, and this type of problem is known to be NP-Complete. You can find approximations to the correct answer in polynomial time, but a guaranteed correct ...
Beska's user avatar
  • 194
6 votes
Accepted

Is it ok to have a class that only has boolean properties?

Yes absolutely it is a good idea because we want the compiler to check as much as possible. If the options were a list of strings any mistypings would not be discovered until runtime. The test you ...
Esben Skov Pedersen's user avatar
6 votes
Accepted

Partial name matching in millions of records

Without knowing the full details of what you need, you probably want to do one of the following: Use an existing search tool, like Sphinx or Lucene Perform n-gram approximate matching I don't fully ...
svidgen's user avatar
  • 14.7k
6 votes

Isn't CQRS overengineering?

CQRS is not a one-for-one replacement for Repositories, exactly because it's a complex, costly pattern which is only useful in some cases. Here's what Udi Dahan has to say in merit: Most people using ...
Sklivvz's user avatar
  • 5,240

Only top scored, non community-wiki answers of a minimum length are eligible