示例#1
0
        public static void Main()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <SocialNetworkDbContext, Configuration>());

            Importer.Create(Console.Out).Import();

            DataSearcher.Search(new SocialNetworkService());
        }
示例#2
0
        public static void Main()
        {
            var data = new SocialNetworkDbContext();

            XmlReader.ImportFriendshipDataFromXml(data);

            XmlReader.ImportPostsDataFromXml(data);

            var searcher = new SocialNetworkService();

            DataSearcher.Search(searcher);
        }
示例#3
0
        public static void Main()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <SocialNetworkEntities, Configuration>());

            var dbContext = new SocialNetworkEntities();

            dbContext.Database.CreateIfNotExists();

            var importer = new XmlImporter(dbContext);

            importer.Import();

            var service = new SocialNetworkService(dbContext);

            DataSearcher.Search(service);
        }
示例#4
0
        public static void Main()
        {
            // prepare table
            var db = new SocialNetworkContext();

            db.Database.Delete();
            db.Database.Create();

            //// task 6 - parsing data from xml
            var parser = new XmlParser(db);

            parser.ParseFriendShipData();
            parser.ParsePostData();

            // task 7 - linq requests to database implemented in MySearcher class
            MySearcher searcher = new MySearcher(db);

            DataSearcher.Search(searcher);
        }