using EMLib.Entity; using EMLib.EqlLib; using EMLib.Global; using EMLib.Orm; using MyNamespace;
EqlSelect stmt = Eql.Select(MyContext.Company). From(MyContext.Company). Where(MyContext.Company.ID > 10);
EqlUpdate stmt = Eql.Update(MyContext.Company). Set(MyContext.Company.CompanyName, "MyCompany"). ThenSetNull(MyContext.Company.Address). From(MyContext.Company). Where(SqlLib.Len(MyContext.Company.Address) < 5);
EqlInsert stmt = Eql.InsertInto(MyContext.Company). Set(MyContext.Company.CompanyName, "MyCompany"). ThenSetNull(MyContext.Company.Address);
EqlDelete stmt = Eql.Delete(MyContext.Company). From(MyContext.Company). Where(SqlLib.Len(MyContext.Company.Address) < 5);
EMContext context = MyContext.CreateContext(pathModel, pathLic); EqlSelect stmt = Eql.Select(MyContext.Company). From(MyContext.Company). Where(MyContext.Company.ID > 5); EMStmeHelper helper = new EMStmeHelper(context); EMStmtUnit txtSql = helper.EqlBuildSqlText(stmt);
SELECT Company.ID, Company.Address, Company.CompanyName, 'Company' AS CurrEntityTag FROM Company WHERE Company.ID > @ParamName1
UPDATE Company SET Company.CompanyName = @ParamName1, Company.Address = NULL FROM Company WHERE Len(Company.Address) < @ParamName2
INSERT INTO Company (Company.CompanyName, Company.Address) VALUES (@ParamName1, NULL)
DELETE Company FROM Company WHERE Len(Company.Address) < @ParamName1
EqlSelect stmt = Eql.Select(MyContext.BaseEntityPoly). From(MyContext.BaseEntityPoly). Where(MyContext.BaseEntityPoly.ID > 10);
SELECT BaseEntity.ID, BaseEntity.BaseName, BaseEntity.CurrEntityTag FROM (SELECT BaseEntity.ID, BaseEntity.BaseName, 'BaseEntity' AS CurrEntityTag FROM BaseEntity UNION ALL SELECT SubEntity.ID, SubEntity.BaseName, 'SubEntity' AS CurrEntityTag FROM SubEntity) AS BaseEntity WHERE BaseEntity.ID > @ParamName1
EqlDelete stmt = Eql.Delete(MyContext.BaseEntityPoly). From(MyContext.BaseEntityPoly). Where(MyContext.BaseEntityPoly.ID > 10);
DELETE PolySubject FROM (SELECT BaseEntity.ID, BaseEntity.BaseName, 'BaseEntity' AS CurrEntityTag FROM BaseEntity UNION ALL SELECT SubEntity.ID, SubEntity.BaseName, 'SubEntity' AS CurrEntityTag FROM SubEntity) AS BaseEntity, BaseEntity AS PolySubject WHERE BaseEntity.ID > @ParamName1 AND BaseEntity.CurrEntityTag = 'BaseEntity' AND PolySubject.ID = BaseEntity.ID DELETE PolySubject FROM (SELECT BaseEntity.ID, BaseEntity.BaseName, 'BaseEntity' AS CurrEntityTag FROM BaseEntity UNION ALL SELECT SubEntity.ID, SubEntity.BaseName, 'SubEntity' AS CurrEntityTag FROM SubEntity) AS BaseEntity, SubEntity AS PolySubject WHERE BaseEntity.ID > @ParamName1 AND BaseEntity.CurrEntityTag = 'SubEntity' AND PolySubject.ID = BaseEntity.ID
EqlDelete stmt = Eql.Delete(MyContext.Company). From(MyContext.Company). Where(MyContext.Company.ID.In(Eql.Select(MyContext.Employee). From(MyContext.Employee). Where(MyContext.Employee.ID < 10)));
EqlSelect stmtSub = Eql.Select(MyContext.Employee). From(MyContext.Employee). Where(MyContext.Employee.ID < 10); EqlDelete stmt = Eql.Delete(MyContext.Company). From(MyContext.Company). Where(MyContext.Company.ID.In(stmtSub));