partial

Feb 19, 2009 at 11:24 AM
Edited Feb 19, 2009 at 11:35 AM

I want to Extend LinqObjectModel, can not find better way.

if

public class LinqObjectModel<T, TKey> : DbObjectModel<T, TKey> where T : LinqObjectModel<T, TKey>

is

public partial class LinqObjectModel<T, TKey> : DbObjectModel<T, TKey> where T : LinqObjectModel<T, TKey>

then

I can custom define something like


public static DbObjectList<T> FindByRange(Expression<Func<T, bool>> condition, Expression<Func<T, object>> orderby,int start,int end)
{
return DbEntry.From<T>().Where(condition).OrderBy(orderby).Range(start,end).Select();
}

or , is there some better idea?

Coordinator
Feb 19, 2009 at 12:56 PM
partial can't help you because they must in the SAME assembly.
But you can implement a new ObjectModel<T, TKey> just like I did in Lephone.Linq.

btw, I think FindByRange is kind of complex and I prefer to use DbEntry.From<T> directly.
Feb 19, 2009 at 1:59 PM

btw:
FindByRange
FindByRangeByDescending
is useful~
--------------
thank you ~