public Person Add(CreatePerson createPerson) { if (createPerson.CityId == 0) { createPerson.CityId = null; } Person createdPerson = _personRepo.Create(createPerson); return(createdPerson); }
public Person Add(CreatePersonViewModel createPerson) { if (createPerson.CityId == 0) //no city { createPerson.CityId = null; } Person createdPerson = _memory.Create(createPerson); return(createdPerson); }
public Person Add(CreatePersonViewModel person) { Person pNew = new Person(); pNew.Name = person.Name; pNew.Phone = person.Phone; pNew.CityId = person.CityId; pNew = _peopleRepo.Create(pNew); return(pNew); }
public Person Add(CreatePerson createPerson) // Service will do the conversion { Person person = new Person(); person.Name = createPerson.Name; person.InCityId = createPerson.InCityId; person.Phone = createPerson.Phone; person = _peopleRepo.Create(person); return(person); // The person is returned with the right Id }
public Person Add(CreatePerson createPerson) { Person person = new Person(); person.FirstName = createPerson.FirstName; person.LastName = createPerson.LastName; person.CurrentCity = createPerson.CurrentCity; person.CellphoneNumber = createPerson.CellphoneNumber; person = _peopleRepo.Create(person); return(person); }
public Person Add(CreatePersonViewModel modelData) { Person newPerson = new Person(); //new person to be added newPerson.FirstName = modelData.FirstName; newPerson.LastName = modelData.LastName; newPerson.PhoneNumber = modelData.PhoneNumber; newPerson.Address = modelData.Address; List <PersonLanguage> allPersonLang = new List <PersonLanguage>(); //placeholder list foreach (int languageID in modelData.ListLanguageID) { PersonLanguage personLang = new PersonLanguage(); //personLang.Language = _langService.FindBy(languageID); personLang.LanguageID = languageID; //createLanguageViewModel.LanguageID; //personLang.Person = newPerson; personLang.PersonID = newPerson.PersonID; allPersonLang.Add(personLang); //_personLangService.Add(id, language.LanguageID); } newPerson.PersonLanguages = allPersonLang; Person personAdded = pr.Create(newPerson); /* Person personAdded = pr.Create(modelData.FirstName, modelData.LastName, modelData.PhoneNumber, modelData.Address); * foreach (int languageID in modelData.ListLanguageID) * { * _personLangservice.Add(personAdded.PersonID, languageID); * }*/ return(personAdded); }
public People Create(PersonViewModel person) { return(_personsRepo.Create(VM_ToDrink(person))); }
//IPeopleRepo _peopleRepo = new InMemoryPeopleRepo(); public Person Add(CreatePersonViewModel person) { return(_peopleRepo.Create(person.Name, person.PhoneNumber, person.City)); }
public Person Add(CreatePersonViewModel createPerson) { return(_peopleRepo.Create(createPerson)); }
public Person Add(CreatePersonViewModel createPerson) { Person person1 = _peopleRepo.Create(createPerson); return(person1); }
public Person Add(CreatePersonViewModel modelData) { Person personAdded = pr.Create(modelData.FirstName, modelData.LastName, modelData.PhoneNumber, modelData.Address); return(personAdded); }
public People Add(CreatePersonViewModel createPersonViewModel) { return(_peopleRepo.Create(createPersonViewModel.Name, createPersonViewModel.PhoneNum, createPersonViewModel.City)); }
public Person Add(CreatePersonViewModel createPersonViewModel) { return(_peopleRepo.Create(createPersonViewModel.Name, createPersonViewModel.City, createPersonViewModel.Country, createPersonViewModel.PhoneNumber)); }