Hammett, this approach will not let the compiler infer it. One of the things that I like about AR<T> is that it is truly zero friction in the common case.
I don't need to do anything to get strongly typed CRUD. @Craig, You may want to take a look here: http://www.ayende.com/Blog/CommentView,guid,8e85135e-aa82-4a77-bd13-45071dc8 715f.aspx That is one way to solve this, but it has its own set of issues. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > hammett > Sent: Tuesday, July 11, 2006 8:52 PM > To: [email protected] > Subject: Re: [Castle-users] Using ActiveRecordValidationBase<T> with > inheritance > > On 7/11/06, Craig Neuwirt <[EMAIL PROTECTED]> wrote: > > I agree. However, even if we did that, how could Employee extend > from > > both ActiveRecordBase<Empoyee> and Person > > It wont. > > class Person : ActiveRecordValidationBase<Person> > > class Employee : Person > { > > public static Employee[] FindAll() > { > return (Employee[]) FindAll( typeof(Employee) ); > } > } > > Another approach would be to get rid of T and instead using only > generic methods. For most cases the compiler will be able to infer the > generic argument. > > Off the top of my head: > > public static Array FindAll<Z>() > { > return (Z[]) ActiveRecordBase.FindAll( typeof(Z) ); } > > using as > > public static Employee[] FindAll() > { > return (Employee[]) FindAll<Employee>(); } > > -- > Cheers, > hammett > http://hammett.castleproject.org/ > > > ----------------------------------------------------------------------- > -- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as- > us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > CastleProject-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/castleproject-users ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ CastleProject-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/castleproject-users
