Skip to content

Conversation

@GoFightNguyen
Copy link

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.

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.
@qinezh
Copy link
Contributor

qinezh commented Oct 12, 2016

Open Publishing Build Service: The pull request content has been published and here are some changed files links of this time:

Status: Succeeded.
Open Publishing Report.

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
@qinezh
Copy link
Contributor

qinezh commented Oct 12, 2016

Open Publishing Build Service: The pull request content has been published and here are some changed files links of this time:

Status: Succeeded.
Open Publishing Report.

let resourceArray = [| "res://*/" |]
let assemblyList = [| System.Reflection.Assembly.GetCallingAssembly() |]
let metaData = MetadataWorkspace(resourceArray, assemblyList)
new EntityConnection(metaData, dbConnection)
Copy link
Contributor

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;")
Copy link
Contributor

@svick svick Oct 12, 2016

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.)

Copy link
Author

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.

Copy link
Contributor

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.

Copy link
Author

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
@qinezh
Copy link
Contributor

qinezh commented Oct 12, 2016

Open Publishing Build Service: The pull request content has been published and here are some changed files links of this time:

Status: Succeeded.
Open Publishing Report.

Based on code-review suggestions, replaced a few let keywords with use since the variables are instances of IDisposable
@qinezh
Copy link
Contributor

qinezh commented Oct 12, 2016

Open Publishing Build Service: The pull request content has been published and here are some changed files links of this time:

Status: Succeeded.
Open Publishing Report.

@cartermp
Copy link
Contributor

LGTM. Thanks, @jasonsnguyen!

@cartermp cartermp merged commit 8c21f9b into dotnet:master Oct 12, 2016
@GoFightNguyen GoFightNguyen deleted the patch-2 branch October 13, 2016 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants