You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
528 B
25 lines
528 B
using System;
|
|
using System.Data;
|
|
using Dapper;
|
|
|
|
namespace NzbDrone.Core.Datastore.Converters
|
|
{
|
|
public class GuidConverter : SqlMapper.TypeHandler<Guid>
|
|
{
|
|
public override Guid Parse(object value)
|
|
{
|
|
if (value == null)
|
|
{
|
|
return Guid.Empty;
|
|
}
|
|
|
|
return new Guid((string)value);
|
|
}
|
|
|
|
public override void SetValue(IDbDataParameter parameter, Guid value)
|
|
{
|
|
parameter.Value = value.ToString();
|
|
}
|
|
}
|
|
}
|