public bool Remove(Guid postID, Guid fileID) { bool removedFile = false; oxite_File foundFile = context.oxite_Files.FirstOrDefault(f => f.FileID == fileID); if (foundFile != null) { oxite_Blogs_PostFileRelationship foundPostFile = context.oxite_Blogs_PostFileRelationships.FirstOrDefault(pfr => pfr.PostID == postID && pfr.FileID == fileID); if (foundPostFile != null) { context.oxite_Files.DeleteOnSubmit(foundFile); context.SubmitChanges(); removedFile = true; } } return(removedFile); }