Пример #1
0
        static void Main(string[] args)
        {
            _context.Database.EnsureCreated();
            _context.GetService <ILoggerFactory>().AddProvider(new MyLoggerProvider());

            // InsertNewPkFkGraph();
            // ModuleForMethods.RunAll();
            //AddRooms();
            // AddManyToManyWithFks();
            //AddManyToManyWithObjects();
            // Console.WriteLine("test");

            //AnonymousTypeViaProjectiom();
            DisconnectedMethods.AddGraphAllNew();
            Console.ReadKey();
        }
Пример #2
0
        static void Main(string[] args)
        {
            _context.Database.EnsureCreated();
            _context.GetService <ILoggerFactory>().AddProvider(new MyLoggerProvider());

            // InsertNewPkFkGraph();
            //InsertNewPkFkGraphMultipleChildren();
            // InsertNewOneToOneGraph();
            //AddChildToExistingObjectWhileTracked();
            //AddOneToOneToExistingObjectWhileTracked();
            //AddBattles();
            //AddManyToManyWithFks();
            //EagerLoadWithInclude();
            //EagerLoadManyToManyAkaChildrenGrandchildren();
            //EagerLoadFilteredManyToManyAkaChildrenGrandchildren();
            //EagerLoadWithMultipleBranches();
            //EagerLoadWithFromSql();
            //EagerLoadViaProjection();
            //EagerLoadAllOrNothingChildrenNope();
            //AnonymousTypeViaProjection();
            //AnonymousTypeViaProjectionWithRelated();
            //RelatedObjectsFixUp();
            //EagerLoadViaProjectionNotQuite();
            //EagerLoadViaProjectionAndScalars();
            //FilteredEagerLoadViaProjectionNope();
            //ExplicitLoad();
            //ExplicitLoadWithChildFilter();
            // UsingRelatedDataForFiltersAndMore();
            // DisconnectedMethods.VerifyingThatOrphanedNewChildDoesntGetSentToDatabase();
#if false
            DisconnectedMethods.AddGraphAllNew();
            DisconnectedMethods.AddGraphWithKeyValues();

            Console.ReadKey(true);
            Console.WriteLine("__________________________");
            DisconnectedMethods.AttachGraphAllNew();
            DisconnectedMethods.AttachGraphWithKeys();


            Console.ReadKey(true);
            Console.WriteLine("__________________________");

            DisconnectedMethods.UpdateGraphAllNew();
            DisconnectedMethods.UpdateGraphWithKeys();
            Console.ReadKey(true);
            Console.WriteLine("__________________________");

            DisconnectedMethods.DeleteGraphAllNew();
            DisconnectedMethods.DeleteGraphWithKeys();
#endif
#if false
            DisconnectedMethods.AddGraphViaEntryAllNew();
            DisconnectedMethods.AddGraphViaEntryWithKeyValues();
            Console.ReadKey(true);
            Console.WriteLine("__________________________");
            DisconnectedMethods.AttachGraphViaEntryAllNew();
            DisconnectedMethods.AttachGraphViaEntryWithKeyValues();
            Console.ReadKey(true);
            Console.WriteLine("__________________________");
            DisconnectedMethods.UpdateGraphViaEntryAllNew();
            DisconnectedMethods.UpdateGraphViaEntryWithKeyValues();
            Console.WriteLine("__________________________");
            DisconnectedMethods.DeleteGraphViaEntryAllNew();
            DisconnectedMethods.DeleteGraphViaEntryWithKeyValues();
#endif
            // DisconnectedMethods.ChangeStateUsingEntry();
#if false
            DisconnectedMethods.AddGraphViaTrackGraphAllNew();
            DisconnectedMethods.AddGraphViaTrackGraphWithKeyValues();
            Console.ReadKey(true);
            Console.WriteLine("__________________________");
            DisconnectedMethods.AttachGraphViaTrackGraphAllNew();
            DisconnectedMethods.AttachGraphViaTrackGraphWithKeyValues();
            Console.ReadKey(true);
            Console.WriteLine("__________________________");
            DisconnectedMethods.UpdateGraphViaTrackGraphAllNew();
            DisconnectedMethods.UpdateGraphViaTrackGraphWithKeyValues();
            Console.ReadKey(true);
            Console.WriteLine("__________________________");
            DisconnectedMethods.DeleteGraphViaTrackGraphAllNew();
            DisconnectedMethods.DeleteGraphViaTrackGraphWithKeyValues();
            Console.ReadKey(true);
            Console.WriteLine("__________________________");
#endif
            DisconnectedMethods.StartTrackingUsingCustomFunction();

            #region inactive methods

            //FullGraphDisconnected
            //EditElementsOfGraph();
            //CompareEntryWithDbSetMethods()
            //DeleteRelatedObjects();

            #endregion
        }
Пример #3
0
        static void Main(string[] args)
        {
            _context.Database.EnsureCreated();
            _context.GetService <ILoggerFactory>().AddProvider(new MyLoggerProvider());

            #region Add Update Delete RawSQL
            Module4Methods.RunAll();
            #endregion

            #region Graph---Lookup
            //InsertNewPkFkGraph();
            //InsertNewPkFkGraphMultipleChildren();
            //InsertNewOneToOneGraph();
            //AddChildToExistingObjectWhileTracked();
            //AddOneToOneToExistingObjectWhileTracked();
            //AddBattles();
            //AddManyToManyWithFks();
            //AddManyToManyWithObjects();
            #endregion

            #region EagerLoad via Include

            // NOT RECOMMENDED

            //EagerLoadWithInclude();
            //EagerLoadManyToManyAkaChildrenGrandchildren();
            //EagerLoadWithMultipleBranches();
            //EagerLoadWithFromSql();
            #endregion

            #region EagerLoad via Projection
            //AnonymousTypeViaProjection();
            //AnonymousTypeViaProjectionWithRelated();
            //RelatedObjectsFixUp();
            //EagerLoadViaProjectionNotQuite();
            //EagerLoadViaProjectionAndScalars();
            //FilteredEagerLoadViaProjectionNope();
            #endregion

            #region Explicit Loading
            //ExplicitLoad();
            //ExplicitLoadWithChildFilter();
            //UsingRelatedDataForFiltersAndMore();
            #endregion

            #region Disconnected Graphs-----Lookups
            //DisconnectedMethods.AddGraphAllNew();
            //DisconnectedMethods.AddGraphWithKeyValues();

            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");
            //DisconnectedMethods.AttachGraphAllNew();
            //DisconnectedMethods.AttachGraphWithKeys();

            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");

            //DisconnectedMethods.UpdateGraphAllNew();
            //DisconnectedMethods.UpdateGraphWithKeys();
            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");

            //DisconnectedMethods.DeleteGraphAllNew();
            //DisconnectedMethods.DeleteGraphWithKeys();
            #endregion

            #region Changes and Additions to Change Tracker -- Track Parent but not Graph(Lookup)
            //DisconnectedMethods.AddGraphViaEntryAllNew();
            //DisconnectedMethods.AddGraphViaEntryWithKeyValues();
            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");
            //DisconnectedMethods.AttachGraphViaEntryAllNew();
            //DisconnectedMethods.AttachGraphViaEntryWithKeyValues();
            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");
            //DisconnectedMethods.UpdateGraphViaEntryAllNew();
            //DisconnectedMethods.UpdateGraphViaEntryWithKeyValues();
            //Console.WriteLine("__________________________");
            //DisconnectedMethods.DeleteGraphViaEntryAllNew();
            //DisconnectedMethods.DeleteGraphViaEntryWithKeyValues();
            #endregion

            #region Change State using Entity Tracking -- Track Graphs(Lookup)
            //DisconnectedMethods.AddGraphViaTrackGraphAllNew();
            //DisconnectedMethods.AddGraphViaTrackGraphWithKeyValues();
            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");
            //DisconnectedMethods.AttachGraphViaTrackGraphAllNew();
            //DisconnectedMethods.AttachGraphViaTrackGraphWithKeyValues();
            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");
            //DisconnectedMethods.UpdateGraphViaTrackGraphAllNew();
            //DisconnectedMethods.UpdateGraphViaTrackGraphWithKeyValues();
            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");
            //DisconnectedMethods.DeleteGraphViaTrackGraphAllNew();
            //DisconnectedMethods.DeleteGraphViaTrackGraphWithKeyValues();
            //Console.ReadKey(true);
            //Console.WriteLine("__________________________");
            #endregion

            #region Track Graph(Lookup) using custom Function
            DisconnectedMethods.StartTrackingUsingCustomFunction();
            #endregion

            Console.WriteLine("Press any key to continue .....");
            Console.ReadLine();
        }