Ejemplo n.º 1
0
        static void EmplServiceTest()
        {
            var emplRepo = new EmployeeRepo(ConnectionString, ProviderName);
            var terrRepo = new TerritoryRepo(ConnectionString, ProviderName);
            var terrs    = new List <Territory>
            {
                new Territory()
                {
                    RegionId = 1, TerritoryDescription = "newnewnewnew", TerritoryID = "covid-19"
                },
                new Territory()
                {
                    RegionId = 1, TerritoryDescription = "dsadasdad", TerritoryID = "0001"
                },
                new Territory()
                {
                    RegionId = 1, TerritoryDescription = "dsadasdad", TerritoryID = "0002"
                },
                new Territory()
                {
                    RegionId = 1, TerritoryDescription = "blblblbllb", TerritoryID = "000001"
                },
            };

            var newEmpl = new Employee("Merzyl", "asus")
            {
                Territories = terrs
            };

            var service = new EmplService(emplRepo, terrRepo);

            service.Insert(newEmpl);
        }
Ejemplo n.º 2
0
        static void TerritoryRepoTest()
        {
            var repo  = new TerritoryRepo(ConnectionString, ProviderName);
            var terrs = new List <Territory>
            {
                new Territory()
                {
                    RegionId = 1, TerritoryDescription = "dsadasdad", TerritoryID = "0001"
                },
                new Territory()
                {
                    RegionId = 1, TerritoryDescription = "rdr2", TerritoryID = "0007"
                },
                new Territory()
                {
                    RegionId = 1, TerritoryDescription = "blblblbllb", TerritoryID = "000001"
                },
            };
            var affected = repo.TryInsertMany(terrs);

            Console.Write("Affected: {0}", affected);
        }