Skip to content

Instantly share code, notes, and snippets.

View xiaomi7732's full-sized avatar
๐Ÿ˜ƒ
Active

Saar Shen xiaomi7732

๐Ÿ˜ƒ
Active
View GitHub Profile
@xiaomi7732
xiaomi7732 / ConfigureOptionsOfT.md
Last active September 24, 2022 19:02
What happens when you call ConfigureOptions<T> on IServiceCollection

What happens when you call ConfigureOptions<T> on IServiceCollection

It will findout all the interfaces on the target type, and if they are one of these interfaces:

  • IConfigureOptions<>
  • IPostConfigureOptions<>
  • IValidateOptions<>

It will register it by calling:

@MSiccDev
MSiccDev / Xamarin.Android.PlatformEncryptionKeyHelper.cs
Last active January 19, 2022 05:33
Helper class to securely create encryption keys without the need of user interaction on Android. There are way to much samples that use some hardcoded values which could be compromised. The keys of this class are only available for usage within the app that created them. Plus, if the app gets uninstalled, the keys get deleted.
using Android.Content;
using Android.OS;
using Android.Security;
using Android.Security.Keystore;
using Java.Math;
using Java.Security;
using Javax.Security.Auth.X500;
using Calendar = Android.Icu.Util.Calendar;
using CalendarField = Android.Icu.Util.CalendarField;