partial void DeleteUser(User instance);
partial void InsertUser(User instance);
partial void UpdateUser(User instance);
private int CreateUser(string username, string password, string email) { var user = (from u in Context.Users where u.name == username //&& u.password == password select u).FirstOrDefault(); if (user != null) { return 2; //user with same name exist } else { RegexUtilities r = new RegexUtilities(); if (!r.IsValidEmail(email)) { return 3; //non-valid email address } var newUser = new User(); newUser.name = username; newUser.password = password; newUser.email = email; newUser.roles = "user"; Context.Users.InsertOnSubmit(newUser); Context.SubmitChanges(); return 1; //user record not found } }