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
552 B
25 lines
552 B
using System;
|
|
using System.Data;
|
|
using Dapper;
|
|
|
|
namespace NzbDrone.Core.Datastore.Converters
|
|
{
|
|
public class SystemVersionConverter : SqlMapper.TypeHandler<Version>
|
|
{
|
|
public override Version Parse(object value)
|
|
{
|
|
if (value is string version)
|
|
{
|
|
return Version.Parse((string)value);
|
|
}
|
|
|
|
return null;
|
|
}
|
|
|
|
public override void SetValue(IDbDataParameter parameter, Version value)
|
|
{
|
|
parameter.Value = value.ToString();
|
|
}
|
|
}
|
|
}
|