SQLテーブルがあり、SilverLightLinq-to-SQLを使用して行を削除したいと思います。Linq-to-SQLは初めてですが、SQLステートメントは次のようになります。
DELETE FROM Lloyds_Selection_Vessel WHERE Selection_ID == inpSelectionID AND ImoNumber == inpImoNumber
Linq-to-SQLステートメントとは何ですか?これは私のコードです:
[OperationContract]
void DeleteSelectionVesselRow(int inpSelectionID, int inpImoNumber)
{
PositionDataClassesDataContext context = new PositionDataClassesDataContext();
context.Lloyds_Selection_Vessels.DeleteAllOnSubmit(context.Lloyds_Selection_Vessels.Where(l => l.Selection_ID == inpSelectionID && x => x.ImoNumber == inpImoNumber));
context.SubmitChanges();
}
テーブル: