public void FindByMethodCall() { var product = new Product() { ProductId = 17 }; var query = new SqlLam<Product>(p => p.ProductId == product.GetProductId()); var result = Connection.Query<Product>(query.QueryString, query.QueryParameters).Single(); Assert.AreEqual(product.ProductId, result.ProductId); }
public void FindByMemberAccessAndMethodCall() { var category = new Category() { CategoryId = 8 }; var product = new Product() { Category = category }; var query = new SqlLam<Category>(c => c.CategoryId == product.Category.GetCategoryId()); var result = Connection.Query<Category>(query.QueryString, query.QueryParameters).Single(); Assert.AreEqual(category.CategoryId, result.CategoryId); }
public void FindByNullableField() { var product = new Product() {ReorderLevel = 5}; var query = new SqlLam<Product>(p => p.NullableReorderLevel == product.NullableReorderLevel.Value); var result = Connection.Query<Product>(query.QueryString, query.QueryParameters).ToList(); Assert.AreEqual(8, result.Count); }