Skip to content

Patch 1 #1147

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

Merged
merged 4 commits into from
Oct 13, 2016
Merged

Patch 1 #1147

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ If you already have an EDMX file, you can skip this step.

#### To create an EDMX file

- If you don't already have an EDMX file, you can follow the instructions at the end of this walkthrough in the step **To configure the Entity Data Model**.
- If you don't already have an EDMX file, you can follow the instructions at the end of this walkthrough in the step [Configuring the Entity Data Model](generating-fsharp-types-from-edmx.md#configuring-the-entity-data-model).
<br />

## Creating the project
Expand Down Expand Up @@ -164,13 +164,13 @@ query {
query {
for course in context.Courses do
where (course.DepartmentID = 1)
select course)
select course
} |> Seq.iter (fun course -> printfn "%s" course.Title)

// Join two tables
query {
for course in context.Courses do
join (for dept in context.Departments -> course.DepartmentID = dept.DepartmentID)
join dept in context.Departments on (course.DepartmentID = dept.DepartmentID)
select (course, dept.Name)
} |> Seq.iter (fun (course, deptName) -> printfn "%s %s" course.Title deptName)
```
Expand All @@ -192,13 +192,13 @@ let nullable value = new System.Nullable<_>(value)
// Throw an exception if more than one matching person is found.
let changeHireDate(lastName, firstName, hireDate) =

query {
for person in context.People do
where (person.LastName = lastName &&
person.FirstName = firstName)
exactlyOne
} |> (fun person ->
context.UpdatePerson(nullable person.PersonID, person.LastName, person.FirstName, nullable hireDate, person.EnrollmentDate))
query {
for person in context.People do
where (person.LastName = lastName &&
person.FirstName = firstName)
exactlyOne
} |> (fun person ->
context.UpdatePerson(nullable person.PersonID, person.LastName, person.FirstName, nullable hireDate, person.EnrollmentDate))

changeHireDate("Abercrombie", "Kim", DateTime.Parse("1/12/1998"))
|> printfn "Result: %d"
Expand Down