public Phone GetOnePhone(int id) { PhoneLogic phoneLogic = new PhoneLogic(DB); Phone phone = phoneLogic.GetOnePhone(id).ConvertToPhone(); return(phone); }
public UserModel AddUser(UserModel userModel) { PhoneModel phoneModel = new PhoneModel(); phoneModel.PhoneNumber = userModel.Phone.PhoneNumber; phoneModel.Loc = userModel.Phone.Loc; PhoneLogic phoneLogic = new PhoneLogic(DB); phoneModel = phoneLogic.AddPhone(phoneModel); userModel.PhoneID = phoneModel.PhoneID; User user = userModel.ConvertToUser(); DB.Users.Add(user); DB.SaveChanges(); userModel.UserID = user.UserId; return(userModel); }