Navigation Menu

Skip to content

Commit

Permalink
Fix links in index.fsx and add .MapTo<'T> to mappers.fsx
Browse files Browse the repository at this point in the history
  • Loading branch information
s952163 committed Oct 2, 2016
1 parent a59c045 commit cd77bde
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
3 changes: 2 additions & 1 deletion SQLProvider.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{14373A98-84EF-4EE2-A4E8-96DEE9FF5BEA}"
ProjectSection(SolutionItems) = preProject
Expand All @@ -27,6 +27,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "core", "core", "{C7E85487-9
docs\content\core\crud.fsx = docs\content\core\crud.fsx
docs\content\core\general.fsx = docs\content\core\general.fsx
docs\content\core\individuals.fsx = docs\content\core\individuals.fsx
docs\content\core\mappers.fsx = docs\content\core\mappers.fsx
docs\content\core\msaccess.fsx = docs\content\core\msaccess.fsx
docs\content\core\mssql.fsx = docs\content\core\mssql.fsx
docs\content\core\mysql.fsx = docs\content\core\mysql.fsx
Expand Down
32 changes: 30 additions & 2 deletions docs/content/core/mappers.fsx
Expand Up @@ -18,7 +18,7 @@ let resolutionPath = __SOURCE_DIRECTORY__ + @"/../../files/sqlite"
This mapper will get sure that you always sync your types with types you receive from your db.
### First add an Domain Model
First add an Domain Model
*)

Expand All @@ -30,11 +30,39 @@ type Employee = {
}

(**
### Then you can create the mapper using dataContext to use generated types from db
Then you can create the mapper using dataContext to use generated types from db
*)

let mapEmployee (dbRecord:sql.dataContext.``main.EmployeesEntity``) : Employee =
{ EmployeeId = dbRecord.EmployeeId
FirstName = dbRecord.FirstName
LastName = dbRecord.LastName
HireDate = dbRecord.HireDate }

(**
SqlProvider also has a `.MapTo<'T>` convenience method:
*)

open System
open FSharp.Data.Sql

type sql = SqlDataProvider<Common.DatabaseProviderTypes.SQLITE,
connectionString,
ResolutionPath = resolutionPath,
CaseSensitivityChange = Common.CaseSensitivityChange.ORIGINAL>

let ctx = sql.GetDataContext()

let orders = ctx.Main.Orders
let employees = ctx.Main.Employees

type Employee2 = {
FirstName:string
LastName:string
}

let qry = query { for row in employees do
select row} |> Seq.map (fun x -> x.MapTo<Employee2>())



9 changes: 5 additions & 4 deletions docs/content/index.fsx
Expand Up @@ -10,14 +10,14 @@ A general .NET/Mono SQL database type provider. Current features:
* [LINQ queries](core/querying.html)
* Lazy schema exploration
* Automatic constraint navigation
* [Individuals](Individuals.html)
* [Individuals](core/Individuals.html)
* Transactional [CRUD](core/crud.html) operations with identity support
* [Stored Procedures](core/programmability.html)
* [Functions](core/programmability.html)
* Packages (Oracle)
* [Composable Query](core/composable.html) integration
* [Composable Query](composable.html) integration
* Optional option types
* Mapping to record types
* [Mapping to record types](core/mappers.html)
* Custom Operators
* Supports [Asynchronous Operations](core/async.html)
Expand Down Expand Up @@ -106,7 +106,7 @@ let mattisOrderDetails =
Samples & documentation
-----------------------
The library comes with comprehensible documentation.
The library comes with comprehensive documentation.
* [General](core/general.html) a high level view on the type providers' abilities and limitations
* [Static Parameters](core/parameters.html) available static parameters
Expand All @@ -116,6 +116,7 @@ The library comes with comprehensible documentation.
* [Programmability](core/programmability.html) usage and limitations of stored procedures and functions
* [Individuals](core/individuals.html) usage and limitations of this unique feature
* [Composable Query](core/composable.html) information on integrating this project with the SQL provider
* [Mapping to record types](core/mappers.html)
* [API Reference](reference/index.html) contains automatically generated documentation for all types, modules
and functions in the library.
Expand Down
Binary file modified docs/files/msaccess/Northwind.MDB
Binary file not shown.
Binary file modified tests/SqlProvider.Tests/db/northwindEF.db
Binary file not shown.

0 comments on commit cd77bde

Please sign in to comment.