22 posts · rss

C#

Everything on this blog written in C#: Microsoft Graph and CSOM client code, Azure Functions, reflection tricks, and the .NET side of Microsoft 365.

Every code sample on this blog is C#, so this topic is close to the full archive. It is here because a fair number of people arrive searching for the .NET side of a Microsoft 365 problem rather than the SharePoint side of it.

What you will find: client code against Microsoft Graph and CSOM, Azure Functions doing the background work, reflection and attributes doing the boring work, and a lot of async plumbing that exists purely because the API on the other end is slower than you would like.

What you will not find: framework tours or language feature walkthroughs. The C# here is in service of a problem I hit, which means the interesting part is usually the API behaviour, not the syntax.

Export files as zip from SharePoint

Dec 1, 2024 · 5 min

Export files as zip from SharePoint

Learn how to download multiple SharePoint files as a zip from C# code, using Graph batching to fetch them and streaming each to disk instead of into memory.

Web Api logging attribute

Feb 18, 2024 · 3 min

Web Api logging attribute

Learn how to move Web API logging out of every controller method and into one C# attribute built on IActionFilter, logging the controller and its parameters.

SQL save changes w. trigger

Feb 3, 2024 · 6 min

SQL save changes w. trigger

Easiest way to keep track of which changes have been made to an object, and likewise, who has carried out these changes.