public bool Register(string unm, string psw) { using (ShuppetModelContainer ctx = new ShuppetModelContainer()) { if (!ctx.User.Any(us => us.username.Equals(unm))) { string rpsw = Reverse(psw); ctx.User.Add(new User { username = unm, password = rpsw }); ctx.SaveChanges(); return(true); } return(false); } }