private user SaveEbayBuyer(UserType buyer, string buyeremail) { // check if buyer already exists using (var repository = new TradelrRepository()) { var newuser = new user() { role = UserRole.USER.ToInt(), email = buyeremail.Contains("@")?buyeremail:"", // this might be invalid request firstName = buyer.UserID, lastName = "", viewid = Crypto.Utility.GetRandomString(), permissions = (int)UserPermission.USER, organisation1 = new organisation { subdomain = sd.id, name = buyer.UserID }, ebay_user = new ebay_user { ebayuserid = buyer.UserID, feedback = buyer.FeedbackScore } }; repository.AddUser(newuser); return(newuser); } }