Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Normally when creating instances of a record, there's no need to fully-qualify each property as you're doing.</p> <pre><code>let authentication = { AuthenticationRecord.Request = request; AuthenticationRecord.UserName = loginRequest.UserName; AuthenticationRecord.Password = loginRequest.Password; AuthenticationRecord.CallbackUI = loginRequest.CallbackUI } </code></pre> <p>As long as the names and types of the properties you're using only match one record type, F# is generally smart enough to figure out what you meant.</p> <pre><code>let authentication = { Request = request; UserName = loginRequest.UserName; Password = loginRequest.Password; CallbackUI = loginRequest.CallbackUI } </code></pre> <p>Also, I might be inclined to use <code>sprintf</code> over <code>String.Format</code> here:</p> <pre><code>String.Format( "j_username={0}&amp;j_password={1}&amp;login={2}", authentication.UserName, authentication.Password, "Login")) sprintf "j_username=%s&amp;j_password=%s&amp;login=%s" authentication.UserName authentication.Password "Login" </code></pre> <p>But since the resulting string is being passed to a <code>StreamWriter</code>, which inherits from <code>TextWriter</code> another option would be to use <a href="http://msdn.microsoft.com/en-us/library/ee370327.aspx" rel="nofollow noreferrer"><code>fprintf</code></a> which writes directly to a <code>TextWriter</code>.</p> <pre><code>fprintf streamWriter "j_username=%s&amp;j_password=%s&amp;login=%s" authentication.UserName authentication.Password "Login" </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload