Sube capa Infrastructure, Solution y archivos de configuracion del Backend
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
using System;
|
||||
|
||||
namespace Infrastructure.Persistance.Converters;
|
||||
|
||||
/// <summary>
|
||||
/// Nullable variant of UtcDateTimeConverter.
|
||||
/// </summary>
|
||||
public class NullableUtcDateTimeConverter()
|
||||
: ValueConverter<DateTime?, DateTime?>(
|
||||
v => v.HasValue ? DateTime.SpecifyKind(v.Value, DateTimeKind.Unspecified) : null,
|
||||
v => v.HasValue ? DateTime.SpecifyKind(v.Value, DateTimeKind.Utc) : null);
|
||||
@@ -0,0 +1,13 @@
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
|
||||
using System;
|
||||
|
||||
namespace Infrastructure.Persistance.Converters;
|
||||
|
||||
/// <summary>
|
||||
/// Converts DateTime values to Unspecified for storage and back to UTC on read, to satisfy the timestamp without time zone column type.
|
||||
/// </summary>
|
||||
public class UtcDateTimeConverter()
|
||||
: ValueConverter<DateTime, DateTime>(
|
||||
v => DateTime.SpecifyKind(v, DateTimeKind.Unspecified),
|
||||
v => DateTime.SpecifyKind(v, DateTimeKind.Utc));
|
||||
Reference in New Issue
Block a user