You know what would be cool... the ability to turn a table and it's data into an Enum via LLBL. For example if I have a table called "Status" and it has in it:
1, Pending,
2, Open,
3, Closed
Something like that, a simple name/value pair table of (almost) static values. It be great if I could tell LLBL to instead of making an entityclass it would just make an enum.
public enum Status
{
Pending = 1,
Open = 2,
Closed = 3
}
and then on, for example the hypothetical Project entity class we get:
public Status StatusUsingStatusId
{
get;//llbl voodoo goes here
set;
}
Main argument for this personally, is for these types of entities I often find myself writing code like - get status where name isn't 'Pending' or get me all of something where it's related status isn't 'Rejected'. Stuff like that. In that case I usually resort to caching the records in the table and doing a quick lookup to get the id of the status called 'Pending'.
But with the magic of enums I could be writing something like:
(from c in meta.Project
where c.StatusId != (int)Status.Closed)
Now there could issues such as the id for 'Closed' being different on my dev db vs prod db... but those issues are easier to manage then all this stuff I have to do at the moment.