コード例 #1
0
ファイル: Demo.cs プロジェクト: Termininja/TelerikAcademy
        public static void Bridge()
        {
            var clientRepository = new ClientRepository();
            var productRepository = new ProductRepository();

            var clientDataObject = new ClientDataObject();
            clientRepository.AddObject(clientDataObject);
            clientRepository.SaveChanges();

            clientRepository.CopyObject(clientDataObject);

            clientRepository.RemoveObject(clientDataObject);
            clientRepository.SaveChanges();

            var productDataObject = new ProductDataObject();
            productRepository.AddObject(productDataObject);
            clientRepository.SaveChanges();

            productRepository.CopyObject(productDataObject);

            productRepository.RemoveObject(productDataObject);
            productRepository.SaveChanges();

            Console.ReadKey();
        }
コード例 #2
0
        public static void Bridge()
        {
            var clientRepository  = new ClientRepository();
            var productRepository = new ProductRepository();

            var clientDataObject = new ClientDataObject();

            clientRepository.AddObject(clientDataObject);
            clientRepository.SaveChanges();

            clientRepository.CopyObject(clientDataObject);

            clientRepository.RemoveObject(clientDataObject);
            clientRepository.SaveChanges();

            var productDataObject = new ProductDataObject();

            productRepository.AddObject(productDataObject);
            clientRepository.SaveChanges();

            productRepository.CopyObject(productDataObject);

            productRepository.RemoveObject(productDataObject);
            productRepository.SaveChanges();

            Console.ReadKey();
        }