New Posts New Posts RSS Feed: Enumeration Classes
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Enumeration Classes

 Post Reply Post Reply
Author
rclarke View Drop Down
Groupie
Groupie


Joined: 14-Jun-2007
Location: United States
Posts: 69
Post Options Post Options   Quote rclarke Quote  Post ReplyReply Direct Link To This Post Topic: Enumeration Classes
    Posted: 29-Oct-2008 at 5:40am
I'm in the process of moving a DevForce Classic application to DevForce EF. In the application I make use of Enumeration Classes which were supported and generated with the Classic Object Mapper. I see no equivilent in DevForce EF Object Mapper and no mention of Enumeration Classes in the EF Developer's Guide. Are they gone? 
Back to Top
kimj View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 09-May-2007
Posts: 1391
Post Options Post Options   Quote kimj Quote  Post ReplyReply Direct Link To This Post Posted: 29-Oct-2008 at 12:04pm
Enumeration classes are not currently supported in DevForce EF.  We've got this on our feature list, but don't have it scheduled yet.
Back to Top
jeffdoolittle View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14-Jun-2007
Location: United States
Posts: 146
Post Options Post Options   Quote jeffdoolittle Quote  Post ReplyReply Direct Link To This Post Posted: 29-Oct-2008 at 9:10pm
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();
      }

Back to Top
rclarke View Drop Down
Groupie
Groupie


Joined: 14-Jun-2007
Location: United States
Posts: 69
Post Options Post Options   Quote rclarke Quote  Post ReplyReply Direct Link To This Post Posted: 30-Oct-2008 at 4:40am
Thanks Jeff,
 
That's exactly what I planed to do and now you have given me a template to use. Great!
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down