Tag Archives: c#

Better cache management in ASP.Net Core (LazyCache/FusionCache)

LazyCache and the newer FusionCache are two great libraries that simplifies working with caching in ASP.Net Core. Something I’ve often been missing though is the ability to dispose of the entire cache, not just single items. (My understanding is that … Continue reading

Posted in Development, Tips | Tagged , , , , | Leave a comment

Modifying SharePoint list permissions with PnP Core

Working with SharePoint permissions is not always straight forward. This code snippet is an exercise using PnP Core to modify permissions on lists with unique (broken) permissions. All assigned permissions are changed to read only, except for owners group of … Continue reading

Posted in Development | Tagged , , , , | Leave a comment

A faster way to get effective permissions with PnP Core

PnP Core SDK has built in functionality to get effective permissions for a user on a list item in SharePoint:

This is pretty slow; typically ~1000ms. So I tried calling the REST API directly instead:

Turns out this … Continue reading

Posted in Development, Tips | Tagged , , , , , | Leave a comment

Searching with Microsoft Graph Client Library for .NET

Using the MS Graph SDK for .NET is convenient but I find the documentation and examples pretty lacking. So when wanted to use the Search endpoint it took me quite a while to figure out how to make it work. … Continue reading

Posted in Development, Tips | Tagged , , , | Leave a comment

Applying SharePoint Retention Labels Programmatically

So you’ve created and published Retention Labels in Office 365 and now you want to apply labels by CSOM code. It’s not very well documented. The following (crude) code should help you get started applying labels to both individual items … Continue reading

Posted in Development | Tagged , , , , , , , , , | 4 Comments

Working with enterprise custom fields in Project Online

I was tasked with with writing a utility for setting Enterprise Custom Fields on User Resources in Microsoft Project Online. The fields got their values from Lookup Tables. Since is was Project Online, the client side object model, CSOM, had … Continue reading

Posted in Development, Tutorials | Tagged , , , , | 1 Comment

Using wildcard matching in any programming language

Most computer savvy persons are familiar with using wildcards when listing files and similar operations. Wildcards are quite easy to understand and use. An asterisk * means match anything, and the lesser known question mark ? matches a single character. … Continue reading

Posted in Development | Tagged , , , , , , , | 1 Comment

Setting “Allow Fill-In” on taxonomy fields with CSOM

SharePoint taxonomy term sets can be open, allowing users to enter new values in the taxonomy picker. For this to work you also need to enable Allow ‘Fill-in’ choices in the site column settings for the managed metadata field connected … Continue reading

Posted in Development | Tagged , , | Leave a comment

Introducing DynForm, a c# library for semi-automatic WinForms dialogs

Application development often involves creating dialogs where the user is presented a form to enter or edit some sort of data. DynForm aims to make development of this a little bit easier. By implementing a simple interface into your data … Continue reading

Posted in Development | Tagged , , , , , , | Leave a comment