8
votes
Recording error messages from an exception
In C# 6 or later you can write it in a single line of code using the null conditional operator (?.) and the null coalescing operator (...
6
votes
Recording error messages from an exception
Assuming you have at least c# 6 (and thus, the null propagation operator), you can simplify it like this:
...
3
votes
Recording error messages from an exception
You can use GetBaseException to get the lowest level exception.
...
2
votes
Web Api to upload excel file
Naming Convention
current code is not using camelCase naming convention on local variables, and also is not given a good naming ...
2
votes
Open closed principle in a method
Before reviewing micro-design we may focus on overall architecture. You already know that in future you will also need to read an Excel file, it may be a good moment to introduce an abstract base ...
2
votes
DbSet<T> IncludeAll method
Include uses when you want to include ICollection properties or not int, string, ...
1
vote
DbSet<T> IncludeAll method
EF knows about all navigation properties. So, instead of using reflection and try to figure it out by myself, I can just ask the DbContext about navigation ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
asp.net-mvc-4 × 100c# × 95
entity-framework × 26
asp.net × 19
mvc × 7
design-patterns × 6
linq × 6
javascript × 5
jquery × 5
performance × 4
sql-server × 4
dependency-injection × 4
controller × 4
asp.net-web-api × 4
authorization × 4
razor × 4
.net × 3
api × 3
asp.net-mvc × 3
beginner × 2
html × 2
json × 2
security × 2
interface × 2
repository × 2