public void AddUser(String Username, String Password) { using (UserDataContext context = new UserDataContext(UserDataContext.DBConnectionString)) { User du = new User(); du.user_name = Username; du.user_pass = Password; context.User.InsertOnSubmit(du); context.SubmitChanges(); } }
public List<User> getUser() { IList<User> usrs = this.GetAllUsers(); List<User> allmsgs = new List<User>(); foreach (User m in usrs) { User n = new User(); n.id = m.ID.ToString(); n.name = m.user_name; n.email = m.user_pass; allmsgs.Add(n); } return allmsgs; }