Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
What is wrong here?
Message
De
04/10/2012 13:53:36
 
 
Information générale
Forum:
ASP.NET
Catégorie:
LINQ
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01554318
Message ID:
01554320
Vues:
66
This message has been marked as a message which has helped to the initial question of the thread.
I assume this is an EF query

var client = Db.Clients.FirstOrDefault(c => c.Id == clientId);


>Hi everybody,
>
>I have this code
>
>
>  int clientId = Convert.ToInt32(Request.Form["ClientId"]);
>                        var client = Db.Clients.Select(c => c.Id == clientId).Single();
>
>                        Db.DeleteClient(client);
>
>and the Db.DeleteClient(client) line produces a compile error.
>
>The signature of the method is
>
> public void DeleteClient(Client client, bool autoCommit = true)
>
>I can not figure out what is wrong and how can I make sure that my var contains a single client object to remove?
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform