17 lines
569 B
C#
17 lines
569 B
C#
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;
|
|
}
|
|
}
|