EAS Web API – Status 28. February

Another month, another release. At least I’m keeping it alive I guess 🙂

No big things this time either:
– I rolled up NuGet updates.
– I changed return types from List<x> to IHttpActionResult (as I mentioned last month I might do). Haven’t gone async yet since I want to go over the rest to see it’s “proper” async if I go that route, but it’s a start.
Nothing magic comes of this as such, but it lends itself to cleaner REST-like behaviour with

return Ok(items);

instead of

return items;

(Silly example I suppose – maybe

return InternalServerError(); 

is a better example.)
– Cleaned up some return values; so for instance instead of an empty JSON object "[]" when no results are found HTTP 204 (No Content) is returned.
– Started implementing the “SendMail” command (not completed yet).

I was made aware of an issue with my conversion from XML to JSON when it comes to contacts. It seems there are cases when the Contact objects are not serialized correctly on my end, so it ends up with a mixing attributes from one contact with another… Yeah, you could indeed call that a nice little bug. So, I’m going over the code there to see what I’m not doing right. (Probably something minor, but my XML parsing isn’t what you would call optimal.) I don’t know yet if this is something impacting other item types as well.

As usual the code is on http://easweb.codeplex.com
and the test site is on https://easweb.azurewebsites.net

EAS Web API – Status 31. January

Fairly minor update this time (as well). Visual Studio 2013 Update 1 was just released, and with it a couple of upgrades to the usual suspects in NuGet.

So I’ve done all NuGet updates including Web API 2.1 and MVC 5.1. (Bunch of other related ones to of course like jQuery, etc., but they’re pretty much the same with my limited UI.)

I’ve also enabled XML documentation generation for the API Help Page. If you open the solution in Visual Studio it’ll spit out about 80 warnings that not all public classes and methods are documented, and I might get around that by just stubbing out something to make it stop complaining. In the meantime I have documented the API controllers, which looks nicer even though they feel mostly self-explanatory.

I haven’t documented the properties of the items returned as these are in a different solution (and as such wouldn’t be included anyways even if I did decorate them). I’m considering whether I should add a ViewModel on top of the models though.

I was looking into Attribute Routing as well, since I’ve been quite happy with that technique in a different project I’ve been hacking on. But it seemed to be better to combine that with some other restructuring. (Going with public async Task<IHttpActionResult> instead of public List<x> perhaps? Although documentation works better if you know the exact type of object you get in return. Hmm…)

As usual the code is on http://easweb.codeplex.com
and the test site is on https://easweb.azurewebsites.net

EAS Web API – Status 31. December

As per usual at this time of year there’s a lot of things to wrap up before the year ends, and December is a busy month. This year was no exception – lot’s of Windows Phone coding fun, been deep digging into Windows Azure Active Directory (haven’t blogged about these topics yet though), and I even managed to squeeze in two certification exams (so I’m finally an MCSD in Web Applications).

Things have been slow on the EAS Web side; not only due to lack of time, but I also felt it might be an idea to go through the Web API stuff I had to do for the exams to see if there was something I was doing plain out wrong and should rethink.

The main issue on the to-do list from the last commit was to do an upgrade based on Visual Studio 2013 having been released. So the change list is rather short:
– Upgraded to MVC5 and Web API 2
– Applied all available NuGet updates.

The upgrade process isn’t entirely automated and there’s a few additional changes needed, so for the manual steps involved look into this article:
How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2:
http://www.asp.net/mvc/tutorials/mvc-5/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2

Of course if you just pull down the changes from Codeplex that doesn’t matter.

Now, if you create a new Web API or MVC project from scratch in VS 2013 you’ll get a decent layout based on Bootstrap. This isn’t included when upgrading, so you could say it still has the feeling of VS 2012, but I felt this wasn’t really an important issue to fix right away. (I’ve been tinkering with Bootstrap on an unrelated MDM project, and I’m liking it so far.)

As usual the code is on http://easweb.codeplex.com
and the test site is on https://easweb.azurewebsites.net

Happy new years!