internal CodeExecutionPathGenerator WithLazyLoadingDatabaseAccessingMethodCall()
        {
            GetDatabaseAccessingMethodCall();

            var entityDeclarationsLoadedByDbCall = new List <DatabaseEntityDeclaration <FakeORMToolType> >()
            {
                customerEntityDeclaration
            };

            dbAccessingMethodCall.SetLoadedEntityDeclarations(entityDeclarationsLoadedByDbCall);

            _codeExecutionPath.AddModel(dbAccessingMethodCall);
            return(this);
        }
Ejemplo n.º 2
0
        public void WithDatabaseAccessingMEthodCallLoadingVariable(DatabaseEntityVariable <LINQToSQL> dbEntityVariable)
        {
            var customerEntityDeclaration = new DatabaseEntityDeclaration <LINQToSQL>("Customer");
            var orderEntityDeclaration    = new DatabaseEntityDeclaration <LINQToSQL>("Order");

            var entityDeclarationsUsedInQuery = new List <DatabaseEntityDeclaration <LINQToSQL> >()
            {
                customerEntityDeclaration
            };
            DatabaseQueryVariable databaseQueryVariable = null;

            var dbQuery = new DatabaseQuery <LINQToSQL>("(from c in dc.Customers where c.Id=1 select c)", entityDeclarationsUsedInQuery, databaseQueryVariable);
            var dbAccessingMethodCall = new DatabaseAccessingMethodCallStatement <LINQToSQL>(dbQuery, null);

            var entityDeclarationsLoadedByDbCall = new List <DatabaseEntityDeclaration <LINQToSQL> >()
            {
                customerEntityDeclaration, orderEntityDeclaration
            };

            dbAccessingMethodCall.SetLoadedEntityDeclarations(entityDeclarationsLoadedByDbCall);

            var dbAccessingMethodCallNode = new ORMModelNode(dbAccessingMethodCall);

            Tree.RootNode.ChildNodes.Add(dbAccessingMethodCallNode);
        }
Ejemplo n.º 3
0
        public ORMModelTreeGenerator WithEagerLoadingDatabaseAccessingMethodCall()
        {
            dbAccessingMethodCall = GetDatabaseAccessingMethodCall();
            var entityDeclarationsLoadedByDbCall = new List <DatabaseEntityDeclaration <LINQToSQL> >()
            {
                customerEntityDeclaration, orderEntityDeclaration
            };

            dbAccessingMethodCall.SetLoadedEntityDeclarations(entityDeclarationsLoadedByDbCall);

            var dbAccessingMethodCallNode = new ORMModelNode(dbAccessingMethodCall);

            Tree.RootNode.ChildNodes.Add(dbAccessingMethodCallNode);

            return(this);
        }