SubSonic Forums
All Your Database Are Belong To Us

Having trouble with RepositoryRecord, DB.Get<>() and Views

Latest post 07-02-2008 12:58 AM by yitzchok. 1 replies.
  • 07-01-2008 10:10 PM

    • oian1
    • Not Ranked
    • Joined on 07-02-2008
    • Posts 1

    Having trouble with RepositoryRecord, DB.Get<>() and Views

    Hello,

    "VClient" is a View. Here's the error when running this code:

    dal.VClient c = DB.Get<dal.VClient>(clientID);

    "The type 'dal.VClient' cannot be used as type parameter 'T' in the generic type or method 'dal.DB.Get<T>(object)'. There is no implicit reference conversion from 'dal.VClient' to 'SubSonic.RepositoryRecord<dal.VClient>'."

    This works fine ("Client" is a Table):

    dal.Client c = DB.Get<dal.Client>(clientID);

    "adminjew" on codeplex responded that:

    "T has to derive from RepositoryRecord<T>"

    Is it possible to use views with RepositoryRecord?

    Thanks

    Filed under: ,
  • 07-02-2008 12:58 AM In reply to

    Re: Having trouble with RepositoryRecord, DB.Get<>() and Views

    I think that you have to use a Select in this case because most times View dont have a primaryKey so you can't use Get<>

    If I am I because I am I, and You are You because You are You, then I am I, and you are you. But If I am I because You are You, and You are You because I am I, then I am not I and You are not You. -Rabbi of Kotzk

Page 1 of 1 (2 items) | RSS