moved conversion into a different project.

This commit is contained in:
David Lebée
2018-04-17 21:43:54 -05:00
parent 118f7c30f8
commit 01e7652c06
17 changed files with 167 additions and 33 deletions
@@ -0,0 +1,13 @@
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);
}
}
@@ -0,0 +1,13 @@
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);
}
}