why you should use a table to represent constant ? have you some "if" on the status ? (as : if( w.Status == WorkFkowStatus.Executing)...)
2009/12/13 rg <[email protected]> > Hi, I'm frequently using some short dictionary tables containing id/ > name columns, for example to represent possible statuses of a simple > workflow. Such table contains few values, like: > > 1, Creating > 2, Accepting > 3, Executing > 4, Finished > 5, Cancelled > > and is referred by an entity representing some business object - so > by joining it I can display current status of the object. My question > is, how to represent such constant references in C# code, so I could > write something like: > > r = new SomeBusinessCase() > r.CreatedDate = DateTime.Now; > r.Status = WorkflowStatus.Accepting; //this should be resolved as > Session.Load<WorkflowStatus>(2); > > As you see, having aliases for constant key references would help keep > the code clean. If such 'consts' were understood by NHibernate, this > could also be used in HQL - like "from SomeBusinessCase where Status > == WorkflowStatus.Executing". Is there something like that in NH, or > what is the best way to achieve something similar? > > Best regards > RG > > -- > > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<nhusers%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > > -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
