Token Based Authentication in ASP.Net using JWTs Part 1

AJLately, I’ve been doing quite a bit of front-end development with the latest version of Angular and that requires token based authentication. So in this article let’s discuss how to create tokens in .Net.  I’ll go over setting up tokens in regular .Net, and in a later article, I’ll discuss how to setup tokens in .Net core.

All of the code can be obtained from Github Here.

Continue reading “Token Based Authentication in ASP.Net using JWTs Part 1”

Quick Way to Create C# Models from SQL Tables

misc1Recently, I was working on a project which used SQLCommands and I need to import a few SQL tables to start using as models. The tables were pretty large so I didn’t want to type them in manually. After a bit of searching, I found something on Stack Overflow that helped me out. Link

The code is pretty simple. You execute it against your table and it’ll output a C# class with all properties based on the table’s columns:

Continue reading “Quick Way to Create C# Models from SQL Tables”

Data Storage: SharePoint v. SQL

Mike BerrymanMany years ago we worked on a project that would allow the client to perform inspections digitally on the various restaurants in their franchise. One of the goals of these inspections was to make sure the restaurants were following the client’s procedures and policies. These procedures and policies are constantly being reviewed and updated, so one of the main requirements of this inspection project was to allow the client to update the inspection on the fly without requiring development updates each time. In other words, it needed to be reasonably configurable by the client. We ultimately created a dynamic form that would be constructed in real-time based on data provided by the client. The idea was that as the client updated their procedures and policies, they would add/remove items from the form to keep it up-to-date.

Continue reading “Data Storage: SharePoint v. SQL”

Spacial Data in SQL Server

3It’s not very often which you deal with spacial data in SQL. In fact, I find it to be a very rare occurrence, but when it does happen, it’s nice to know that there are two libraries for it: geometry (which is for Euclidean Geometry) and geography (which uses lat/long, and takes into account the curvature of the earth).

Continue reading “Spacial Data in SQL Server”

Scope Identity and You

Mike BerrymanI had a situation recently where I was doing an insert into a SQL table from some C# code and then immediately had to perform some operations on other object using the newly inserted entry’s Id.  Now, I’ve done this sort of thing in the past but it’s always been on a system where I could be relatively assured no one else would be touching the table I was using except through the system I was developing and therefore I could get the freshly inserted entry’s Id just by doing a simple…

Continue reading “Scope Identity and You”