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.
26 lines
590 B
26 lines
590 B
using System;
|
|
using System.Data;
|
|
using Dapper;
|
|
using NzbDrone.Common.Disk;
|
|
|
|
namespace NzbDrone.Core.Datastore.Converters
|
|
{
|
|
public class OsPathConverter : SqlMapper.TypeHandler<OsPath>
|
|
{
|
|
public override void SetValue(IDbDataParameter parameter, OsPath value)
|
|
{
|
|
parameter.Value = value.FullPath;
|
|
}
|
|
|
|
public override OsPath Parse(object value)
|
|
{
|
|
if (value == null || value is DBNull)
|
|
{
|
|
return new OsPath(null);
|
|
}
|
|
|
|
return new OsPath((string)value);
|
|
}
|
|
}
|
|
}
|