Handling PATCH updates in a Web API service

I was working on a project where my client wanted a Web API service so various external portals could add and update members in CRM. Doing this I came across a problem called PATCH.

In the REST world it is very common to update items by only sending the changed data and leaving out the other variables. Let's imagine a "contact" entity where I only want to update the first name and leave the last name unchanged.


Get the text from a CRM option list through it's value

When you retrieve a record from CRM and one of the fields is a so called option set you might have noticed that only the numeric value is available.

With lookup fields (entity references) you can get the Id and Name directly but with option sets that doesn't work. I've seen lots of ways to retrieve the text via a value but this one I wanted to share with you because it is simple and straight forward.


CRM dates one day too early when accessing them via LINQ

For one of my a clients I had to make something to import records from their old invoicing system into the new CRM via csv files. When this was completed it had to export result data they would use to check if all the data was transferred correctly. Because they had to "practice" this import many times I decided to make a Windows Forms application and access the CRM data via the API using LINQ.


Session variables are lost when using eBay SDK

I was working with the eBay SDK for a client of mine and every time I posted a new product to eBay via their SDK the session was lost and I was redirected to the login page of the CMS.

When I was looking around the code and the folder structure of the application, I noticed that the SVN icon of the file "listing_log.txt" in the "bin" folder turned red so something change it. Since I was reusing some of the eBay example code I noticed this part where the log file is written. Every time some file in the "bin" folder is changed .NET rebuilds the application so this is why the session variables where lost.