partial void DeleteUserProfile(UserProfile instance);
partial void InsertUserProfile(UserProfile instance);
partial void UpdateUserProfile(UserProfile instance);
public static UserProfile Save(UserProfile profile) { if (profile.UserId == 0) { //save the user. using (ExamSystemDataContext db = new ExamSystemDataContext()) { db.UserProfiles.InsertOnSubmit(profile); db.SubmitChanges(); } } else { //update user } return null; }