Created
January 24, 2013 21:45
-
-
Save thePunderWoman/4628151 to your computer and use it in GitHub Desktop.
insert testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vcdb_VehiclePart vp = new vcdb_VehiclePart(); | |
try { | |
vp = db.vcdb_VehicleParts.Where(x => x.VehicleID.Equals(vehicle.ID) && x.PartNumber.Equals(vpart.partID)).First(); | |
} catch { | |
vp = new vcdb_VehiclePart { | |
PartNumber = vpart.partID, | |
VehicleID = vehicle.ID | |
}; | |
db.vcdb_VehicleParts.InsertOnSubmit(vp); | |
db.SubmitChanges(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment