dotnet-dynamic-linq/PoweredSoft.Conversion/Converters/StringToGuidConverter.cs
2018-04-17 21:43:54 -05:00

14 lines
433 B
C#

using PoweredSoft.Types.Interface;
using System;
using System.Collections.Generic;
using System.Text;
namespace PoweredSoft.Types.Converters
{
public class StringToGuidConverter : ITypeConverter
{
public bool CanConvert(Type source, Type destination) => source == typeof(string) && destination == typeof(Guid);
public object Convert(object source, Type destination) => Guid.Parse((string)source);
}
}