mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-08-23 22:11:36 +08:00
PgSql Support datetimeoffset
This commit is contained in:
parent
7ab2e9ce6d
commit
79a6a72bbf
@ -25,6 +25,15 @@ namespace OrmTest
|
||||
id2=new TimeSpan(11,2,1)
|
||||
}).ExecuteCommand();
|
||||
var x= Db.Queryable<UnitTimeSpan2>().ToList();
|
||||
Db.CodeFirst.InitTables<UnitDateOfTime22>();
|
||||
Db.Insertable(new UnitDateOfTime22() { DateTimeOffset1 = DateTimeOffset.Now }).ExecuteCommand();
|
||||
var list2 = Db.Queryable<UnitDateOfTime22>().ToList();
|
||||
|
||||
}
|
||||
[SqlSugar.SugarTable("UnitDateOfTime221")]
|
||||
public class UnitDateOfTime22
|
||||
{
|
||||
public DateTimeOffset DateTimeOffset1 { get; set; }
|
||||
}
|
||||
public class UnitTimeSpan2
|
||||
{
|
||||
|
@ -28,6 +28,8 @@ namespace SqlSugar
|
||||
csharpTypeName = "long";
|
||||
if (csharpTypeName.ToLower().IsIn("boolean", "bool"))
|
||||
csharpTypeName = "bool";
|
||||
if (csharpTypeName == "DateTimeOffset")
|
||||
csharpTypeName = "DateTime";
|
||||
var mappings = this.MappingTypes.Where(it => it.Value.ToString().Equals(csharpTypeName, StringComparison.CurrentCultureIgnoreCase)).ToList();
|
||||
if (mappings!=null&&mappings.Count>0)
|
||||
return mappings.First().Key;
|
||||
|
Loading…
Reference in New Issue
Block a user