This weekend I decided to try setting up a simple Web API with .NET Core and Docker running it on Linux. The process was really straightforward. I got it up and running almost immediately. So I decided to share the process.
I have been using Angular for over 3 years. A few months ago Angular 1.5 came out and they introduced the
.component() method, which is basically the same as an element directive but with a much simpler API. Since then I’ve fallen more and more in love with Angular so I decided to write a small todo app utilizing the component architecture along with some cool things in the Angular world.
First of all I’m not much of a designer so I want to thank TodoMVC for the UI.
Anyway, the app consists of:
- Angular 1.5 because of components!
- UI-Router 1.0.0-beta.1 so I can route to components
- MobX for managing my state
- Webpack for module bundling
I’m not gonna talk much about these in depth, only high-level about what they are and why I chose them. This article will mainly be about how I decided to structure and implement the app.
Version 2 of Sublime Text was initially released in 2011 and last release was in July 2013. Still it’s the main version! Version 3 last release was in March 2015 — and it’s still in beta and hasn’t gotten an update for 10 months. Don’t get me wrong, Sublime is awesome, but it’s not under active development. Atom is very active and has been from the start, Sublime is not. Atom is also open-source, Sublime is not.
However, this is about my Atom setup, not a rant about why Atom is better than Sublime.
This article will teach you how to set up a basic service and repository, to isolate your BLL (Business Logic Layer) from your DAL (Data Access Layer), so you can easily create unit tests for your BLL. This solution doesn’t use any ORM (Object Relational Mapping) like e.g. Entity Framework. This is only to explain how to isolate logic from data and how to test your logic in isolation.
Config Transforms are a nifty method to have your configuration vary, depending on which build configuration you are running or what servers you are publishing to. This gets the most useful when you’re deploying to many kinds of different servers; Development, staging, production, etc.
NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.
This post will create you how to create and publish your own NuGet package.
I had a problem with SimpleMembership, Authorize attributes and roles. When I ran my program, I occasionally got the following error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 – Error Locating Server/Instance Specified)
To fix it, I had to go to
/Account/LogOff and log in again. Very weird problem. I tried Googling it without any luck, until I stumpled upon this blog post. That saved my day. I decided to write down the method here, in case if his blog went down. For users who stumble upon this problem. Continue reading
Before Microsoft released MVC 4, I created my project with the good old ASP.NET Membership Provider. After release of MVC 4, Microsoft switched to SimpleMembership by WebMatrix. My project was pretty huge, so I searched for an upgrade path to switch without harming the project. I was in no luck finding a method to switch over, so I followed my own “upgrade path” and decided to share it with the world.