//add user public static void addUser(UsersEntities user, Car_DetailsEntities car) { if (user != null) { Users newUser = UsersEntities.convertUserEntitiesToUserTbl(user); // Car_Details newCar = Car_DetailsEntities.convertCarDetailsEntitiestoCarDetailsTbl(car); DB.Users.Add(newUser); // DB.Car_Details.Add(newCar); } }
//function that check if user is exists public static Boolean ExistUser(UsersEntities user) { Users u = UsersEntities.convertUserEntitiesToUserTbl(user); if (DB.Users.Any(x => x.Mail == u.Mail)) //when exists user { return(false); } return(true); }