Exemplo n.º 1
0
        public void InserCountry(string[] countries)
        {
            try
            {
                List<Country> lstCountries = new List<Country>();
                foreach (string c in countries)
                {
                    Country country = new Country();
                    country.CountryName = c.Trim();
                    country.DateCreated = DateTime.Now;
                    lstCountries.Add(country);
                }

                context.Countries.InsertAllOnSubmit(lstCountries);
                context.SubmitChanges();
            }
            catch (Exception ex)
            {
                throw;
            }
        }
 partial void UpdateCountry(Country instance);
 partial void DeleteCountry(Country instance);
 partial void InsertCountry(Country instance);