anchor.diff:                 | _ -> buildEntityProperty<obj> name need)
           |> Seq.toList)
       
  +    let buildParameter name need buildType =
  +        match need with
  +        | Mandatory -> ProvidedParameter(name, buildType)
  +        | Optional -> ProvidedParameter(name, buildType, optionalValue = true)
  +
  +    // Build a constructor as well.
       entityType.AddMemberDelayed(fun () -> 
  +        // Split into mandatory and optional parameters - we add the mandatory ones first.
  +        let mandatoryParams, optionalParams = properties |> List.partition(function (_,_, Mandatory) -> true | _ -> false) 
           let parameters = 
               [ ProvidedParameter("PartitionKey", typeof<Partition>)
                 ProvidedParameter("RowKey", typeof<Row>) ] 
  -            @ [ for (name, edmType, need) in properties -> buildEdmParameter edmType (buildParameter name) ]
  +            @ [ for (name, edmType, need) in mandatoryParams -> buildEdmParameter edmType (buildParameter name need) ]
  +            @ [ for (name, edmType, need) in optionalParams -> buildEdmParameter edmType (buildParameter name need) ]
           ProvidedConstructor(
               parameters, 
  -            InvokeCode = fun args -> 
  -                let fieldNames = 
  -                    properties
  -                    |> Seq.map(fun (name, _, _) -> name)
  -                    |> Seq.toList                
  +            InvokeCode = fun args ->
  +                printfn "Args: %A" (args |> List.map(fun a -> a, a.Type))
                   let fieldValues = 
                       args
                       |> Seq.skip 2
                       |> Seq.map (fun arg -> Expr.Coerce(arg, typeof<obj>))
  -                    |> Seq.toList                
  +                    |> Seq.toList
  +
  +                printfn "Values: %A" fieldValues
  +                let fieldNames =
  +                    (mandatoryParams @ optionalParams)
  +                    |> Seq.take fieldValues.Length
  +                    |> Seq.map(fun (name, _, _) -> name)
  +                    |> Seq.toList
  +                printfn "Names: %A" fieldNames
                   <@@ buildTableEntity (%%args.[0] : Partition) (%%args.[1] : Row) fieldNames (%%(Expr.NewArray(typeof<obj>, fieldValues))) @@>))
       properties
   
  
positive.code:     | EdmType.String -> builder typeof<string>
      | _ -> builder typeof<obj>
  
  let buildParameter name buildType = ProvidedParameter(name, buildType)
  
  /// Sets the properties on a specific entity based on the inferred schema from the sample provided
  let setPropertiesForEntity (entityType : ProvidedTypeDefinition) (sampleEntities : #seq<DynamicTableEntity>) = 
      let properties = sampleEntities |> getDistinctProperties
      entityType.AddMembersDelayed(fun _ -> 
          properties
          |> Seq.map (fun (name, edmType, need) -> 
  
negative.code: open ProviderImplementation.ProvidedTypes
  open System
  
  let private getPropsForEntity (entity:DynamicTableEntity) =
      entity.Properties
      |> Seq.filter(fun p -> p.Value.PropertyAsObject <> null)
      |> Seq.map(fun p -> p.Key, p.Value.PropertyType)
      |> Set
  
  let private getDistinctProperties tableEntities = 
      let optionalProperties, mandatoryProperties, _ =
          ((Set [], Set [], true), tableEntities)
          ||> Seq.fold(fun (optionals, mandatory, initialRun) entity ->
              if initialRun then
                  optionals, entity, false
  