title: In F#, how is an interface cast within a lambda expression?
body: <p>I'm finding the concept of interfaces in F# to be significantly different then C#.</p>
  
  <pre><code>The following code in F# works correctly:
  
  type MyVisit = {
          lastname : string
          firstname : string
          birthdate : DateTime
          appointment_time : DateTime
          service_time : DateTime
          posting_time : DateTime
          chart_number : int
      }
  
  module FsNetwork =
      let context = Wsdl1.GetBasicHttpBinding_IMedicalService()
      let GetScheduleAsync (tableDate : DateTime) =
          async {
              let! data = context.GetOfficeScheduleAsync(tableDate) |&gt; Async.AwaitTask
              return data |&gt; Seq.map(fun q -&gt; {
                  MyVisit.lastname = q.lastname
                  firstname = q.firstname
                  birthdate = q.birthdate
                  appointmentTime = q.appointment_time
                  tservice = q.service_time
                  posting_time = q.posting_time
                  chart_number = q.chart_number
                  })                  
          }
         |&gt; Async.StartAsTask
  </code></pre>
  
  <p>However, when implementing the interface of:</p>
  
  <pre><code>type IVisit = 
      abstract member lastname: string with get
      abstract member firstname: string with get
      abstract member mi: string with get
      abstract member birthdate: Nullable&lt;DateTime&gt; with get
      abstract member appointmentTime : System.Nullable&lt;DateTime&gt; with get
      abstract member tservice : System.Nullable&lt;DateTime&gt; with get
      abstract member postingTime : System.Nullable&lt;DateTime&gt; with get
      abstract member chartNumber : System.Nullable&lt;int&gt; with get
  
  type Visit = 
      interface IVisit with 
          member this.lastname = "lastname"
          member this.firstname = "FirstName"
          member this.mi = "mi"
          member this.birthdate = Nullable(DateTime(2020, 1, 1))
          member this.appointmentTime = Nullable(DateTime(2020, 1, 1)) 
          member this.tservice = Nullable(DateTime(2020, 1, 1)) 
          member this.postingTime = Nullable(DateTime(2020, 1, 1)) 
          member this.chartNumber = Nullable(0)
  </code></pre>
  
  <p>The lambda now fails with
  <em>The type 'Visit' does not define the field, constructor or member 'lastname'</em></p>
  
  <pre><code>module FsNetwork =
      let context = Wsdl1.GetBasicHttpBinding_IMedicalService()
      let GetScheduleAsync (tableDate : DateTime) =
          async {
              let! data = context.GetOfficeScheduleAsync(tableDate) |&gt; Async.AwaitTask
              return data |&gt; Seq.map(fun q -&gt; {
                  Visit.lastname = q.lastname
                  firstname = q.firstname
                  birthdate = q.birthdate
                  appointmentTime = q.appointment_time
                  tservice = q.service_time
                  posting_time = q.posting_time
                  chart_number = q.chart_number
                  })                  
          }
         |&gt; Async.StartAsTask
  </code></pre>
  
  <p>Attempting to cast 'Visit' with Visit:>IVisit.lastname =..., or Visit:#IVisit.lastname =... also fail. I'm sure its simple, how is this done?</p>
  
  <p>Thanks for any help.</p>