Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.

Programming and Learning from SD WebApi
If I Made a New Web App over the Last 12 Years
Have you thought about how you've built web applications in the past and how you want to do it now?

Please visit me at for my reflections.

Posted On Wednesday, June 14, 2017 4:33 PM

Tip for a WebApi, Json and System.Net.Http.Formatting exception
My colleague, Brian, had this problem and posted it on our Slack channel. I suggested he share it out further, and since he isn’t blogging yet (I keep encouraging him to do so), I offered to post it for him. He thinks this would mainly happen to something other than an MVC site. In his case it was a console application which didn't have WebApi packages included by default. There was a pretty popular solution that involved by passing the ReadAsAsync<MyModel>() call and instead doing a ReadAsStream() ......

Posted On Tuesday, December 15, 2015 3:18 PM

$.ajax and WebApi example
I showed $.ajax at lunch yesterday and I've put up my code on github. There’s a simple javaScript class example and a Knockout example for comparison. I also avoided using jQuery (except for the $.ajax). I also added a knockout example to you can compare a simple example. Getting WebApi setup threw me for a loop. Use GlobalConfiguration.Configu... Also I needed some help to post a primitive value to a WebApi method. EDIT: August 25, 2015: I updated my AjaxExample using a data ......

Posted On Wednesday, August 19, 2015 6:12 PM

Securing WebAPI and stopping CSRF requests
I just read this article in the June MSDN magazine by Peter Vogel and thought it needed to be highlighted. If you're using WebAPI you should think about Cross-Site Request Forgeries. It also applies to the 70-487 test. "ASP.NET doesn’t automatically protect you against Cross-Site Request Forgery (CSRF/XSRF) attacks (more on that later)." "When a user accesses an ASP.NET site using Forms Authentication, ASP.NET generates a cookie that stipulates the user is authenticated. The browser will continue ......

Posted On Monday, June 10, 2013 10:43 AM

Faking the WebApi User
I needed to unit test a WebAPI call in my MVC 4 application that checks the user's role. I'm doing this in my MVC controllers with the following code using FakeItEasy (I should do a post on that sometime): this.UserPrincipalFake = A.Fake<IPrincipal>(); A.CallTo(() => this.UserPrincipalFake.Iden... A.CallTo(() => this.UserPrincipalFake.Iden... this.HttpContextBaseFake = A.Fake<HttpContextBase&g... this.HttpContextBaseFake.User ......

Posted On Wednesday, June 5, 2013 10:29 AM

Copyright © Aligned | Powered by: