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.
22 lines
698 B
22 lines
698 B
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
|
using System; |
|
using System.Collections.Generic; |
|
using System.Linq; |
|
using System.Threading.Tasks; |
|
|
|
namespace AX.FireTrainingSys |
|
{ |
|
/// <summary> |
|
/// 类型转换辅助类。 |
|
/// </summary> |
|
public static class ConverterHelper |
|
{ |
|
/// <summary> |
|
/// DateTime 到 string 的类型转换。 |
|
/// </summary> |
|
/// <returns></returns> |
|
public static ValueConverter<DateTime, string> DateTimeToStringConverter() => new ValueConverter<DateTime, string>( |
|
v => v.ToString("yyyy-MM-dd HH:mm:ss"), |
|
v => DateTime.SpecifyKind(DateTime.Parse(v), DateTimeKind.Utc)); |
|
} |
|
}
|
|
|