anchor.diff:                              failwith "'lastOrDefault' operator has no translations for Sql Server"
   
                           let star = ["* "], []
  -                        let selectColumn, selectParameters = 
  +                        let selectColumn, selectParameters, constructorInfo = 
                               match count with
  -                            | Some c-> ["COUNT(*) "], []  //not fully implemented
  +                            | Some c-> 
  +                                ["COUNT(*) "], [], [
  +                                    {
  +                                        Type = typedefof<int>
  +                                        SingleOrMulti = Single(getSelectIndex())
  +                                    }
  +                                ]
                               | None -> 
                                   match contains with 
                                   | Some c -> 
  -                                    ["CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END "], []
  +                                    ["CASE WHEN COUNT(*) > 0 THEN 1 ELSE 0 END "], [] , [
  +                                        {
  +                                            Type = typedefof<bool>
  +                                            SingleOrMulti = Single(getSelectIndex())
  +                                        }
  +                                    ]
                                   | None -> 
                                       match maxOrMin with 
                                       | Some m ->
  -                                        let q, p = (getLambda(m).Body |> map2) 
  -                                        q @ [" "], p
  +                                        failwith "not implemented, need to implement the construction info"
  +//                                        let q, p = (getLambda(m).Body |> map) 
  +//                                        q @ [" "], p
                                       | None -> 
                                           match select with
                                           | Some s->
                                               match getLambda(s) with
  -                                            | SingleSameSelect _ -> star
  +                                            | SingleSameSelect x -> 
  +                                                let query, ctor, indexChange = createSelect (getSelectIndex()) x.Type
  +                                                incrementSelectIndex indexChange
  +                                                query, [], [ctor]
                                               | l -> 
  -                                                let q, p = (getLambda(m).Body |> map2) 
  -                                                q @ [" "], p
  -                                        | None -> star
  +                                                failwith "not implemented, need to implement the construction info"
  +//                                                let q, p = (getLambda(m).Body |> map) 
  +//                                                q @ [" "], p
  +                                        | None -> failwith "not implemented, need to call createSelect with the type" //star
   
                           let topStatement = 
                               let count = 
  
positive.code: ﻿namespace FSharp.QueryProvider.QueryTranslator
  
  type PreparedParameter<'T> =
      {
          Name : string
          Value : obj 
          DbType : 'T
      }
  
  type PreparedStatement<'P> =
      {
          Text : string
          FormattedText : string
          Parameters : PreparedParameter<'P> seq
      }
  
  type IQueryable = System.Linq.IQueryable
  type IQueryable<'T> = System.Linq.IQueryable<'T>
  
negative.code:                         failwith "dont think this should ever get hit"
                          //Some ["SELECT * FROM "; q.ElementType.Name]
                      else if c.Value = null then
                          Some (["NULL"] ,[], [])
                      else
                          Some (valueToQueryAndParam c.Value)
                  | MemberAccess m ->
                      if m.Expression <> null && m.Expression.NodeType = ExpressionType.Parameter then
                          Some ([m.Member.Name], [], [])
                      else
                          failwithf "The member '%s' is not supported" m.Member.Name
                  | _ -> None
  
              match result with
              | Some r -> ExpressionResult.Skip, r
              | None -> ExpressionResult.Recurse, ([], [], [])
  //            if result.IsSome then 
  //                ExpressionResult.Skip, result
  //            else
  