Skip to content

Instantly share code, notes, and snippets.

@ba55ie
Last active February 8, 2017 10:35
Show Gist options
  • Save ba55ie/e296f539981d1005bdad765f528391e6 to your computer and use it in GitHub Desktop.
Save ba55ie/e296f539981d1005bdad765f528391e6 to your computer and use it in GitHub Desktop.
.NET and C#

Information

Tips, tricks an tutorials

General coding information

Questions and remarks

  • Resharper adds the using imports within the namespace (Interface Class). Why and what's preferrred?
  • Constructor before properties? Yep, it's a stylecop rule.
  • When to use this? The examples leave it out, but I prefer return this.NotFound(); in the Controllers.
  • A models ID should be a private setter or something? And does it work when using a DB? This doesn't feel right to me.
  • Named routes or RedirectToAction?
  • Using statement using (FileStream fs = File.Create(DataFile))?
  • Prefer static methods? (See todo respository).

Misc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment