public static void CreatedUser() { do { Console.WriteLine("Name: "); name = Console.ReadLine(); Console.WriteLine("Last name: "); lastname = Console.ReadLine(); Console.WriteLine("Age: "); age = int.Parse(Console.ReadLine()); Console.WriteLine("Email: "); email = Console.ReadLine(); } while (name == "" || lastname == ""); PersonProfile person = new PersonProfile(name,lastname,age,email); db.User_profile.Add(person); db.SaveChanges(); }
public static void CreatedUser() { do { Console.WriteLine("Name: "); name = Console.ReadLine(); Console.WriteLine("Last name: "); lastname = Console.ReadLine(); Console.WriteLine("Age: "); age = int.Parse(Console.ReadLine()); Console.WriteLine("Email: "); email = Console.ReadLine(); } while (name == "" || lastname == ""); PersonProfile person = new PersonProfile(name, lastname, age, email); db.User_profile.Add(person); db.SaveChanges(); }