public PersonLanguage Create(PersonLanguage personLanguage) { _peopleDbContext.Add(personLanguage); if (_peopleDbContext.SaveChanges() > 0) { return(personLanguage); } return(null); }
public Language Create(Language language) { _peopleDbContext.Add(language); if (_peopleDbContext.SaveChanges() > 0) { return(language); } return(null); }
public Country Create(Country country) { _peopleDbContext.Add(country); int ret = _peopleDbContext.SaveChanges(); if (ret == 0) { return(null); } return(country); }
public City Create(City city) { _peopleDbContext.Add(city); int ret = _peopleDbContext.SaveChanges(); if (ret == 0) { return(null); } return(city); }
public Person Create(Person person) { _peopleDbContext.Add(person); int change = _peopleDbContext.SaveChanges(); if (change == 0) // no change in db. { throw new Exception("Unable to add person to database"); } //ny för att få med city namn etc till personTable. person = Read(person.Id); return(person); }