Hot answers tagged

33 votes
Accepted

How do big companies maintain their products' source code without it falling into wrong hands?

You're overestimating the importance of source code, and underestimating the importance of everything else in the value chain of selling software. Sure, a contractor might steal your source code. But ...
user avatar
28 votes
Accepted

Benefits of using separate API and UI servers for Web application

One reason is security - if (haha! when) a hacker gains access to your front-end webserver, he gets access to everything it has access to. If you've placed your middle tier in the web server, then he ...
user avatar
  • 48k
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 ...
user avatar
24 votes
Accepted

Should an ASP.NET MVC application directly use Entity Framework as the model?

In my applications I have always separated things out, with different models for the database (Entity Framework) and MVC. I have separated these out into different projects too: Example.Entities - ...
user avatar
  • 1,374
24 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 ...
user avatar
21 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 ...
user avatar
  • 4,000
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 ...
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-...
user avatar
  • 9,017
20 votes
Accepted

Difference between 3-Tier architecture and MVC (Model, View Controller) in ASP.Net

This is like asking what the difference is between an apple and an apple core. These two architectures aren't replacements for one another. I think a more accurate view is that the 3-tier architecture ...
user avatar
18 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 ...
user avatar
  • 37.5k
17 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 ...
user avatar
  • 9,017
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.
user avatar
  • 54.7k
14 votes

Why does IIS default to Recycling the Application Pool every 1740 minutes?

1740 minutes is 29 hours: Back when IIS 6 was being developed—which is the version that introduced application pools—a default needed to be set for the Regular Time Interval when application ...
user avatar
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 ...
user avatar
  • 256
13 votes
Accepted

ASP.NET deployment/maintenance best practices

ASP.NET MVC applications are compiled. This means that you can't just upload the changed files, like you do with a PHP website, for example. This also means that when you'll start to update the site, ...
user avatar
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 ...
user avatar
  • 124k
11 votes
Accepted

Storing 5000 elements on client side in a web application

I agree with the comments that he was likely looking for HTML5 local storage, and may have expected you to have experience with it. Frankly, unless it was an integral requirement of the job and you ...
user avatar
  • 3,509
10 votes

Anything wrong with direct evaluation of JSON if your own code created it?

Suppose I have a server-side variable containing JSON, called strJSON that my own code created. Was it created entirely by your code? Are you certain that at no point does it add in a piece of user ...
user avatar
10 votes
Accepted

When and why to use Page.ResolveUrl

Suppose you had made a User Control that you were going to use on many different pages. Part of the User Control is a link to the Home page. If you use the User Control on a page that is more than ...
user avatar
  • 401
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 ...
user avatar
  • 2,642
9 votes

What kind of user info is ok to be stored as plain text in SQL Database?

Passwords must be stored hashed always, and make sure they are never logged, for example by query loggers. Hashing is important as opposed to encryption, because it should be a one-way, nonreversible ...
user avatar
  • 1,819
9 votes
Accepted

Never using Models, only ViewModels

Would my Data project be considered the "Model" for my application? Yes, that's exactly what Model is supposed to be. Is this a right approach I believe it is. or could there be potential ...
user avatar
  • 35.5k
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 ...
user avatar
9 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 ...
user avatar
  • 64.6k
9 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 ...
user avatar
  • 2,414
8 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 ...
user avatar
8 votes
Accepted

Email service or simply abstract email out and call from?

Basically, you have two issues here: E-mails are dispatched from presentation layer, The API is tied up to physical e-mail implementation. The first issue is solved by the first step of moving the ...
user avatar
8 votes

Storing 5000 elements on client side in a web application

The 'correct' answer - at least, the one they were looking for - was indeed HTML5 LocalStorage (an excellent link by Steven Burnap). And the interviewer was probably being...well, I believe the ...
user avatar
  • 6,072
8 votes
Accepted

Why Session has implemented this way in Asp.net

The underlying issue is not Session or Asp.Net specific, it is a fundamental issue in how collections in statically typed languages work. The Session object is designed to let you store objects of any ...
user avatar
  • 54.7k
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 ...
user avatar
  • 54.7k

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