public void AddCountry(string Code, string Name) { DictionaryCountry current = new DictionaryCountry(); current.DictionaryCountryCode = Code; current.DictionaryCountryName = Name; this._dbContext.DictionaryCountry.Add(current); this._dbContext.SaveChanges(); }
public DictionaryCountryModel GetCountry(int countryId) { { DictionaryCountry country = _dbContext.DictionaryCountry.Where(a => a.DictionaryCountryId == countryId).FirstOrDefault(); DictionaryCountryModel countryModels = new DictionaryCountryModel(); countryModels.DictionaryCountryId = country.DictionaryCountryId; countryModels.DictionaryCountryName = country.DictionaryCountryName; countryModels.Code = country.DictionaryCountryCode; return(countryModels); } }
public void InsertCountry(CountryModel countryModel) { var country = new DictionaryCountry() { DictionaryCountryId = countryModel.DictionaryCountryId, CountryName = countryModel.CountryName, CountryCode = countryModel.CountryCode }; _untoldContext.DictionaryCountry.Add(country); _untoldContext.SaveChanges(); }
public void InsertConferenceCountry(string cod, string name) { var country = _electriccastleContext.DictionaryCountry.ToList(); var countrys = new DictionaryCountry { DictionaryCountryId = _electriccastleContext.DictionaryCountry.Max(x => x.DictionaryCountryId) + 1, CountryCode = cod, DictionaryCountryName = name }; _electriccastleContext.DictionaryCountry.Add(countrys); _electriccastleContext.SaveChanges(); }