public User Citaj(string username) { var context = new Users_databaseEntities(); var temp = context.Users.Where(s => s.username == username).ToList <User>(); foreach (User item in temp) { return(item); } return(null); }
public void Pisi(string username, string lozinka, string rola) { var context = new Users_databaseEntities(); var user = new User { username = username, lozinka = lozinka, rola = rola }; User u = context.Users.Find(username); if (u == null) { context.Users.Add(user); context.SaveChanges(); } }