public void NonComposableScalarValuedFunctionTest() { using (AdventureWorks adventureWorks = new AdventureWorks()) { decimal? cost = adventureWorks.ufnGetProductStandardCost(999, DateTime.Now); Assert.IsNotNull(cost); Assert.IsTrue(cost > 1); } }
public void NonComposableScalarValuedFunctionLinqTest() { using (AdventureWorks adventureWorks = new AdventureWorks()) { try { adventureWorks .Products .Where(product => product.ListPrice >= adventureWorks.ufnGetProductStandardCost(999, DateTime.Now)) .ToArray(); Assert.Fail(); } catch (NotSupportedException exception) { Trace.WriteLine(exception); } } }