- 
                Notifications
    
You must be signed in to change notification settings  - Fork 6.1k
 
Update generating-fsharp-types-from-edmx.md #1137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
In the step "To find or create the connection string for the Entity Data Model," correcting the indentation of the getEDMConnectionString function. Also in that function, correcting the name of the parameter passed into the new SqlConnection() function.
| 
           Open Publishing Build Service: The pull request content has been published and here are some changed files links of this time: 
 Status: Succeeded.  | 
    
In the section "Configuring the type provider," add the closing " on the ResolutionFolder static parameter when initializing the edmx. This fix allows the next line to longer look like it is a string. In the same section, also correct the indentation of the call to getEDMConnectionString
| 
           Open Publishing Build Service: The pull request content has been published and here are some changed files links of this time: 
 Status: Succeeded.  | 
    
| let resourceArray = [| "res://*/" |] | ||
| let assemblyList = [| System.Reflection.Assembly.GetCallingAssembly() |] | ||
| let metaData = MetadataWorkspace(resourceArray, assemblyList) | ||
| new EntityConnection(metaData, dbConnection) | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function returns a connection not a connection string, so shouldn't it be named getEDMConnection?
| let edmConnectionString = | ||
| getEDMConnectionString("Data Source=SERVER\instance;Initial Catalog=School;Integrated Security=true;") | ||
| getEDMConnectionString("Data Source=SERVER\instance;Initial Catalog=School;Integrated Security=true;") | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to above, this is a connection, so I think the variable should be named edmConnection.
Also, EntityConnection is disposable, so shouldn't use be used here instead of let? (And probably for context below too.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed the suggestions for the name changes. I'm not familiar enough with use to be able to make that decision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed on the use of use here, since they are disposable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced those two let with use
Based on a code review, renaming EDMConnectionString functions and variables to EDMConnection
| 
           Open Publishing Build Service: The pull request content has been published and here are some changed files links of this time: 
 Status: Succeeded.  | 
    
Based on code-review suggestions, replaced a few let keywords with use since the variables are instances of IDisposable
| 
           Open Publishing Build Service: The pull request content has been published and here are some changed files links of this time: 
 Status: Succeeded.  | 
    
| 
           LGTM. Thanks, @jasonsnguyen!  | 
    
Correcting the getEDMConnectionString function
In the step "To find or create the connection string for the Entity Data Model," correcting the indentation of the getEDMConnectionString function. Also in that function, correcting the name of the parameter passed into the new SqlConnection() function.