Category Archives: C#

How to Fix “No ‘Access-Control-Allow-Origin’ header” in ASP.NET WebAPI

I am not 100% sure what Google did to Chromium in Update 42.  However after that update landed I started to get reports of our Angularjs application started to have problems communicating with our ASP.NET WebAPI.  We started getting errors … Continue reading

Posted in ASP.NET, C#, Web | Tagged | Leave a comment

Order the controllers in ASP.NET WebAPI Help

Recently I started a new API project for my company.  With this project I decided to give the Help files generator that Microsoft created a try.  Overall it looks like it will meet the needs of the project.  Today however … Continue reading

Posted in ASP.NET, C# | Tagged | 3 Comments

Split a PCM Stereo into multiple mono files by channel

For this you can read and write the data streams as you like, to keep things simple I am using NAudio.  This should negate the need to write custom stream readers/writers to get channel/header information.  First thing we need to … Continue reading

Posted in C# | Tagged | Leave a comment

How to Unit Test a Private/Protected Method with MSTEST

Note: these steps work for both private and protected methods Search online or post this question on Stack Overflow and guess what you will get in response most of the time.   Don’t do it, I repeat Do not unit test … Continue reading

Posted in C# | Tagged | Leave a comment

Battle of the INotifyPropertyChanged techniques

Recently at a conference I was given the opportunity to talk about Aspect Orientated programming with PostSharp.  In my demo I showed off the difference between creating an INotifyPropertyChanged class manually, using boilerplate code generated by Resharper, and using smart … Continue reading

Posted in C#, PostSharp | Tagged , , | 1 Comment

Call WCF Service Asynchronously

Why would we want to call a WCF Service asynchronously? The biggest reason to move from synchronous to asynchronous is performance.  When a synchronous call is made, the current thread locks till the call is completed.  It varies by OS … Continue reading

Posted in C#, VB.NET, Web | Tagged | Leave a comment

C# Data Structures – ArrayList

In the last topic we talked about the Array.  It was mentioned that an Array was a fixed size and fixed typed.  The ArrayList is classified as a dynamic array. It implements the IList interface which simplifies add, insert, and … Continue reading

Posted in C# | Tagged , | Leave a comment

C# Data Structures – Array

The Array is one of the simplest and most memory efficient of the data structures.  An array is a fixed list of items.  These items can be of any type and 99.9% of the time are the same type of … Continue reading

Posted in C# | Tagged , | 1 Comment

C# Data Structures – Queue

Continuing on from my article about Stacks we are going to look at the Queue Data Structure.  Queue is similar to the Stack with one difference it follows First in First out.  By default the initial capacity of a queue … Continue reading

Posted in C# | Tagged , | Leave a comment

C# Data Structures – Stack

So a while ago I was in an accounting class learning about inventory management utilizing the First in First out (FIFO) and Last in First out (LIFO).   Since I think about things in ones and zeros I related them to … Continue reading

Posted in C# | Tagged , | 1 Comment