Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Shaped Entities
Message
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Versions des environnements
Environment:
ASP.NET
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01368835
Message ID:
01385587
Vues:
60
Bob,

>So this works with one problem. I cannot overload the GetEntity method with the new view based Entity class. For example, the following overload (as listed in the Dev Guide) works:
>
>
>public mmBindingList<VTraderListEntity> GetTradersByClientID(int clientID, string listOption)
>        {
>            return this.GetEntityList<VTraderListEntity>("TraderViewSelectByClientID",
>                this.CreateParameter("@ClientID", clientID), this.CreateParameter("@ListOption", listOption));
>        }
>
>
>But the following does not:
>
>
>public VTraderListEntity GetTraderbyTraderID(int traderID)
>        {
>            return this.GetEntity<VTraderListEntity>("TraderViewSelectByPK", this.CreateParameter("@TraderID", traderID));
>        }
>
>
>The error says the method (GetEntity) cannot be used with type arguments. Since I know that this stored procedure can only return 1 record, I am not returning it using mmBindingList. Any suggestions on how to handle this? I guess I could just use the GetEntityList method (even though I know that only one record would be returned) but I would like to hear some other suggestions before going this route.

We didn't provide a GetEntity() method that accepted a generic type parameter because we wanted to stress that you should really only use different shapes of data for read-only lists...so, using GetEntityList() works fine even if you have just one item returned.

Best Regards,
Kevin McNeish
Eight-Time .NET MVP
VFP and iOS Author, Speaker & Trainer
Oak Leaf Enterprises, Inc.
Chief Architect, MM Framework
http://www.oakleafsd.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform