public void DeleteImage(Guid imageID) { var img = Imgs.Where(i => i.ImageID == imageID).SingleOrDefault(); if (img == null) { return; } Imgs.DeleteOnSubmit(img); SubmitChanges(); }
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(); }