Skip to content

Instantly share code, notes, and snippets.

@conwid
conwid / IniFormatter.cs
Last active May 16, 2023 14:37
More complete IFormatter implementation reference for students preparing for MS 70-483
public class IniFormatter : IFormatter
{
public class IniTypeBinder : SerializationBinder
{
public override Type BindToType(string assemblyName, string typeName) => Type.GetType(typeName.Split('=')[1]);
public override void BindToName(Type serializedType, out string assemblyName, out string typeName)
{
assemblyName = $"{IniFormatter.AssemblyNameKey}={serializedType.Assembly.FullName}";
typeName = $"{IniFormatter.ClassNameKey}={serializedType.AssemblyQualifiedName}";
}
@conwid
conwid / 01Extending user info
Last active May 16, 2023 16:43
Data model extensions
The first demo shows how to extend the user information stored in the database.
The second demo shows how to extend authorization using the custom user info.
Demos showcasing data protection capabilities of ASP.NET Identity Core
Creating a custom ticket store
Extending anti-forgery tokens in ASP.NET Core
Demo showing how to hook up custom callbacks for token creation and validation.