Smark.Data是基于Ado.net实现的数据访问组件,提供基于强类型的查询表达式进行灵活的数据查询,统计,修改和删除等操作;采用基于条件驱动的操作模式,使数据操作更简单轻松;内部通过标准SQL92实现对不同数据的支持,包括MSSQL,ORACLE,SQLITE,ACCESS等。 主要功能
1.8使用简介
[TestMethod] public void Result_GetValue() { Query<Employee> query = 3; Console.WriteLine(query.Value.FirstName); } [TestMethod] public void Result_GetValue1() { Query<Employee> query = Employee.employeeID == 3; Console.WriteLine(query.Value.FirstName); } [TestMethod] public void Result_GetValue2() { Query<Employee> query = "employeeid=3"; Console.WriteLine(query.Value.FirstName); } [TestMethod] public void Result_GetValue3() { Query<string> query = "select firstName from employees where employeeid=3"; Console.WriteLine(query.Value); } [TestMethod] public void Result_GetValues1() { Query<List<Employee>> query = ""; foreach (Employee item in query.Value) { Console.WriteLine(item.FirstName); } } [TestMethod] public void Result_GetValues2() { //存储过程 CustOrderHist coh = new CustOrderHist(); coh.CustomerID = "ALFKI"; Query<IList<OrderHist>> query = coh; foreach (OrderHist item in query.Value) { Console.WriteLine(item.ProductName); } }