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