Update demo

This commit is contained in:
sunkaixuan 2021-02-04 17:30:11 +08:00
parent b519201e4a
commit 18e37307b3
3 changed files with 6 additions and 3 deletions
Src/Asp.Net
OracleTest/Demo
SqlServerTest/Demo
SqlSugar/ExpressionsToSql/DbMethods

View File

@ -132,7 +132,8 @@ namespace OrmTest
datetime=it.CreateTime
})
.ToList();
var list3 = db.Queryable<Order>().Where(it => it.CreateTime.Date == SqlFunc.Oracle_ToDate("2021-1-21", "yyyy-MM-dd")).ToList();
var list4 = db.Queryable<Order>().Select(it => SqlFunc.Oracle_ToChar(DateTime.Now, "yyyy-MM-dd")).ToList();
Console.WriteLine("#### SqlFunc End ####");
}

View File

@ -130,6 +130,8 @@ namespace OrmTest
.Any()
).ToList();
var list3=db.Queryable<Order>().Select(it => SqlFunc.SqlServer_DateDiff("day", DateTime.Now.AddDays(-1), DateTime.Now)).ToList();
Console.WriteLine("#### Subquery End ####");
}

View File

@ -140,8 +140,8 @@ namespace SqlSugar
public static int CharIndex(string findChar,string searchValue) { throw new NotSupportedException("Can only be used in expressions"); }
public static int BitwiseAnd(int left, int right) { throw new NotSupportedException("Can only be used in expressions"); }
public static int BitwiseInclusiveOR(int left, int right) { throw new NotSupportedException("Can only be used in expressions"); }
public static DateTime Oracle_ToDate(object date,string format) { throw new NotSupportedException("Can only be used in expressions"); }
public static string Oracle_ToChar(object date, string format) { throw new NotSupportedException("Can only be used in expressions"); }
public static DateTime Oracle_ToDate(string date,string format) { throw new NotSupportedException("Can only be used in expressions"); }
public static string Oracle_ToChar(DateTime date, string format) { throw new NotSupportedException("Can only be used in expressions"); }
public static int SqlServer_DateDiff(string dateType,DateTime date1,DateTime date2) { throw new NotSupportedException("Can only be used in expressions"); }
}
}