Stuff and things
This commit is contained in:
16
PartSource.Data/Converters/TypeToStringConverter.cs
Normal file
16
PartSource.Data/Converters/TypeToStringConverter.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq.Expressions;
|
||||
using System.Text;
|
||||
|
||||
namespace PartSource.Data.Converters
|
||||
{
|
||||
public class TypeToStringConverter : ValueConverter<Type, string>
|
||||
{
|
||||
public TypeToStringConverter() : base(TypeToString, StringToType) { }
|
||||
|
||||
public static Expression<Func<string, Type>> StringToType = value => Type.GetType(value);
|
||||
public static Expression<Func<Type, string>> TypeToString = value => value.AssemblyQualifiedName;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user