예제 #1
0
        public void AddZipCodes()
        {
            var zip2list = _zipRepository2.GetAll();

            foreach (var code2 in zip2list)
            {
                try
                {
                    var city = _cityRepository.GetSingle(x => x.Name == code2.City);
                    if (city != null)
                    {
                        ZipCodes code = new ZipCodes();
                        code.CityId      = city.CityId;
                        code.Number      = Convert.ToInt32(code2.ZipCode);
                        code.IsActive    = true;
                        code.IsDeleted   = false;
                        code.CreatedDate = DateTime.Now;
                        _zipRepository.Add(code);
                    }
                    else
                    {
                    }
                }
                catch
                {
                    continue;
                }
            }
        }
예제 #2
0
        public void Can_Add_Single_Entity()
        {
            var addEntity = zRepo.Add(zipStubs[1]);

            Assert.IsNotNull(addEntity);
        }