partial void DeleteImg(Img instance);
partial void InsertImg(Img instance);
partial void UpdateImg(Img instance);
public void UpdateImage(Guid imageID, byte[] data, string name) { var img = Imgs.Where(i => i.ImageID == imageID).SingleOrDefault(); if (img == null) { img = new Img { ImageID = imageID, Data = data, Name = name }; Imgs.InsertOnSubmit(img); } else { img.Data = data; img.Name = name; } SubmitChanges(); }