private un_personlanguages Gen_Languages(GenericPersonViewModel gen, int id) { var query = Person_Language.GetAll(); var result = query.FirstOrDefault(f => f.id_person == id); if (result != null && gen.PersonLanguagesViewModel != null) { result.id_language = gen.PersonLanguagesViewModel.id_language; result.id_person = gen.PersonLanguagesViewModel.id_person; result.id_languageLevel = gen.PersonLanguagesViewModel.id_languageLevel; result.id_personLanguage = gen.PersonLanguagesViewModel.id_personLanguage; } return(result); }
public PersonLanguagesViewModel LanguagesView(int id_person) { PersonLanguagesViewModel result = new PersonLanguagesViewModel(); var per_lang = Person_Language.GetAll(); var query = per_lang.FirstOrDefault(f => f.id_person == id_person); if (query == null) { result = null; } else { result.id_language = query.id_language; result.id_person = query.id_person; result.id_languageLevel = query.id_languageLevel; result.id_personLanguage = query.id_personLanguage; } return(result); }