public void TearDown() { using (ProductDataSession session = new ProductDataSession("sales")) { session.Delete <AgeRange>(a => a.AgeRangeId > 4); } }
public void Insert1_Warmup() { using (ProductDataSession session = new ProductDataSession("sales")) { AgeRange ageRange = new AgeRange { Max = 20, Min = 0 }; session.Insert(ageRange); } }
public void Insert2_ThreadRepeat() { ThreadedRepeat(Iterations, (index, asserter) => { using (ProductDataSession session = new ProductDataSession("sales")) { AgeRange ageRange = new AgeRange { Max = 20 + index, Min = 0 + index }; session.Insert(ageRange); } }); }
public void Insert3_Parallel() { Parallel.For(0, Iterations, index => { using (ProductDataSession session = new ProductDataSession("sales")) { AgeRange ageRange = new AgeRange { Max = 20 + index, Min = 0 + index }; session.Insert(ageRange); } }); }
[Test] //], Ignore("Self referential table joins are not yet supported.")] public void ManualJoinSameTable() { const string expected = "SELECT * FROM [Production].[Category] _t0, [Production].[Category] _t1 WHERE _t0.[ParentId] = _t1.[CategoryId] AND _t1.[ApplicationId] = 1 "; using (ProductDataSession session = new ProductDataSession()) { EntitySet <Category> entitySet = session.Categorys; entitySet.Join <Category>(Category.Columns.ParentId == Category.Columns.CategoryId); entitySet.Where(Category.Columns.ApplicationId == 1); AssertCommandTextSame(expected, entitySet); AssertParamCountSame(entitySet, 2); } }