Can you temporarily create the enumeration manually? Here's an example against a "Category" entity class that is backed by the NorthwindIB.Category table:
public static Category Beverages() { return Beverages(DomainModelEntityManager.DefaultManager); }
public static Category Beverages(EntityManager em) { return GetCategoryByName(em, "Beverages"); }
public static Category Condiments() { return Condiments(DomainModelEntityManager.DefaultManager); }
public static Category Condiments(EntityManager em) { return GetCategoryByName(em, "Condiments"); }
public static Category Produce() { return Produce(DomainModelEntityManager.DefaultManager); }
public static Category Produce(EntityManager em) { return GetCategoryByName(em, "Produce"); }
private static Category GetCategoryByName(EntityManager em, string categoryName) { var query = new EntityQuery<Category>("Categories", em); return query.Where(c => c.CategoryName == categoryName).FirstOrNullEntity(); }
|