mirror of
https://github.com/bitwarden/server.git
synced 2026-02-02 23:23:15 +08:00
20 lines
472 B
C#
20 lines
472 B
C#
|
|
using System;
|
|||
|
|
using System.Data;
|
|||
|
|
using Dapper;
|
|||
|
|
|
|||
|
|
namespace Bit.Infrastructure.Dapper.Repositories
|
|||
|
|
{
|
|||
|
|
public class DateTimeHandler : SqlMapper.TypeHandler<DateTime>
|
|||
|
|
{
|
|||
|
|
public override void SetValue(IDbDataParameter parameter, DateTime value)
|
|||
|
|
{
|
|||
|
|
parameter.Value = value;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override DateTime Parse(object value)
|
|||
|
|
{
|
|||
|
|
return DateTime.SpecifyKind((DateTime)value, DateTimeKind.Utc);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|