moved conversion into a different project.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user