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

14 lines
441 B
C#

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