#if NET6_0_OR_GREATER
using System;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
namespace AMWD.Common.EntityFrameworkCore.Converters
{
///
/// Defines the conversion from a object to a which can be handled by the database engine.
///
///
/// As of 2022-06-04 only required for Microsoft SQL server on .NET 6.0.
///
public class DateOnlyConverter : ValueConverter
{
///
/// Initializes a new instance of the class.
///
public DateOnlyConverter()
: base(
d => d.ToDateTime(TimeOnly.MinValue),
d => DateOnly.FromDateTime(d)
)
{ }
}
}
#endif