private static void FindEnumsAndAssert(Expression expression, params Type[] types) { var res = FindEntityTypes.Apply(expression); foreach (var t in types) { Assert.IsTrue(res.Enumerations.ContainsKey(t)); } }
private static void FindEntitiesAndAssert(Expression expression, IEnumerable <Type> types, IEnumerable <Type> ignored) { var res = FindEntityTypes.Apply(expression); foreach (var t in types) { Assert.IsTrue(res.Entities.ContainsKey(t)); } foreach (var t in ignored) { Assert.IsFalse(res.Entities.ContainsKey(t)); } }
/// <summary> /// Transforms an expression by replacing entity types using the type substitutor provided in the constructor. /// </summary> /// <param name="expression">The expression to transform.</param> /// <returns>An expression with entity types replaced.</returns> public virtual Expression Apply(Expression expression) { if (expression == null) { return(null); } var entityInfo = FindEntityTypes.Apply(expression); CompileEntityTypes(entityInfo); var result = _substitutor.Apply(expression); return(result); }