Added suport for DynamicColumn in DynamicProcedureInvoker
This commit is contained in:
@@ -5,13 +5,14 @@ namespace Tester
|
||||
{
|
||||
internal class Program
|
||||
{
|
||||
private static DynamORM.DynamicDatabase GetORM()
|
||||
private static DynamicDatabase GetORM()
|
||||
{
|
||||
return new DynamORM.DynamicDatabase(System.Data.SqlClient.SqlClientFactory.Instance,
|
||||
return new DynamicDatabase(System.Data.SqlClient.SqlClientFactory.Instance,
|
||||
//"packet size=4096;User Id=sa;Password=Sa123;data source=192.168.1.9,1434;initial catalog=MAH_Melle-GAGARIN;",
|
||||
"packet size=4096;User Id=sa;Password=sa123;data source=192.168.1.9,1433;initial catalog=MOM_NEXT_Florentyna_WMS_PROD;",
|
||||
DynamORM.DynamicDatabaseOptions.SingleConnection | DynamORM.DynamicDatabaseOptions.SingleTransaction | DynamORM.DynamicDatabaseOptions.SupportStoredProcedures |
|
||||
DynamORM.DynamicDatabaseOptions.SupportSchema | DynamORM.DynamicDatabaseOptions.SupportTop);
|
||||
//"packet size=4096;User Id=sa;Password=sa123;data source=192.168.1.9,1433;initial catalog=MOM_NEXT_Florentyna_WMS_PROD;",
|
||||
"packet size=4096;User Id=sa;Password=sa123;data source=192.168.0.6;initial catalog=DynamORM;",
|
||||
DynamicDatabaseOptions.SingleConnection | DynamicDatabaseOptions.SingleTransaction | DynamicDatabaseOptions.SupportSchema |
|
||||
DynamicDatabaseOptions.SupportStoredProcedures | DynamicDatabaseOptions.SupportTop | DynamicDatabaseOptions.DumpCommands);
|
||||
|
||||
////return new DynamORM.DynamicDatabase(System.Data.SQLite.SQLiteFactory.Instance,
|
||||
//// "Data Source=test.db3;",
|
||||
@@ -21,30 +22,43 @@ namespace Tester
|
||||
|
||||
private static void Main(string[] args)
|
||||
{
|
||||
var c = new System.Data.SqlClient.SqlConnection("packet size=4096;User Id=sa;Password=Sa123;data source=127.0.0.1,1434;initial catalog=MAH_Levant;");
|
||||
var c = new System.Data.SqlClient.SqlConnection("packet size=4096;User Id=sa;Password=sa123;data source=192.168.0.6;initial catalog=DynamORM;");
|
||||
|
||||
DynamicDatabase db = new DynamicDatabase(c,
|
||||
DynamicDatabaseOptions.SingleConnection | DynamicDatabaseOptions.SingleTransaction | DynamicDatabaseOptions.SupportSchema |
|
||||
DynamicDatabaseOptions.SupportStoredProcedures | DynamicDatabaseOptions.SupportTop | DynamicDatabaseOptions.DumpCommands);
|
||||
|
||||
try
|
||||
using (var db = GetORM())
|
||||
{
|
||||
try
|
||||
{
|
||||
db.Execute("DROP TABLE Experiments ");
|
||||
}
|
||||
catch { }
|
||||
|
||||
db.Execute("CREATE TABLE Experiments (t1 nvarchar(50) NOT NULL DEFAULT N'', t2 varchar(50) NOT NULL DEFAULT '');");
|
||||
|
||||
//var q = db.From(x => x.Experiments.As(x.e1));
|
||||
//q
|
||||
// .Where(x => x.t2 = "Dupa")
|
||||
// .Where(x => x.Exists(
|
||||
// q.SubQuery()
|
||||
// .From(y => y.Experiments.As(x.e2))
|
||||
// .Where(y => y.e2.t1 == y.e1.t1)))
|
||||
// .Execute().ToList();
|
||||
|
||||
db.Execute("DROP TABLE Experiments ");
|
||||
|
||||
var resL = db.Procedures.GetProductDesc<IOrderedEnumerable<GetProductDesc_Result>>();
|
||||
var res = db.Procedures.GetProductDesc_withparameters<GetProductDesc_Result>(PID: 707);
|
||||
res = db.Procedures.GetProductDesc_withDefaultparameters<GetProductDesc_Result>();
|
||||
|
||||
int id = -1;
|
||||
var resD = db.Procedures.ins_NewEmp_with_outputparamaters(Ename: "Test2", out_EId: id);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
db.Execute("CREATE TABLE Experiments (t1 nvarchar(50) NOT NULL DEFAULT N'', t2 varchar(50) NOT NULL DEFAULT '');");
|
||||
|
||||
var q = db.From(x => x.Experiments.As(x.e1));
|
||||
q
|
||||
.Where(x => x.t2 = "Dupą")
|
||||
.Where(x => x.Exists(
|
||||
q.SubQuery()
|
||||
.From(y => y.Experiments.As(x.e2))
|
||||
.Where(y => y.e2.t1 == y.e1.t1)))
|
||||
.Execute().ToList();
|
||||
|
||||
db.Execute("DROP TABLE Experiments ");
|
||||
private class GetProductDesc_Result
|
||||
{
|
||||
public virtual int ProductID { get; set; }
|
||||
public virtual string ProductName { get; set; }
|
||||
public virtual string ProductDescription { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user