You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/core/mappers.fsx
+30-9Lines changed: 30 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,10 @@ type sql = SqlDataProvider<
20
20
21
21
(**
22
22
23
-
## Adding a Mapper using dataContext to use generated types from db
23
+
## Adding a Mapper using dataContext to use generated types from the DB
24
24
25
-
Typically F# is about writing business logic and not about OR-mapping. Consider using your database types as is. But sometimes you want to
26
-
map objects to different, for example to interact with other languages like C# domain.
27
-
28
-
This mapper will ensure that you always sync your types with those you receive from your DB.
25
+
Typically, F# is about writing business logic and not about OR-mapping. Consider using your database types as is. And select only the columns you need, not full entities. But sometimes you want to
26
+
map objects to different ones, for example to interact with other languages like C# domain.
29
27
30
28
First, add a Domain Model
31
29
@@ -41,7 +39,7 @@ type Employee = {
41
39
}
42
40
43
41
(**
44
-
Then you can create the mapper using dataContext to use generated types from db
42
+
Then you can create the mapper using dataContext to use the generated types from the DB
templateCont.AddXmlDocDelayed(fun()->"As this is erasing TypeProvider, you can use the generated types. However, if you need manual access to corresponding type, e.g. to use it in reflection, this will generate you a template of the runtime type. Copy and paste this to use however you will (e.g. with MapTo).")
"The location to look for dynamically loaded assemblies containing database vendor specific connections and custom types. Types used in desing-time: If no better clue, prefer .NET Standard 2.0 versions. Semicolon to separate multiple.",
1182
+
"The location to look for dynamically loaded assemblies containing database vendor specific connections and custom types. Types used in design-time: If no better clue, prefer .NET Standard 2.0 versions. Semicolon to separate multiple.",
1095
1183
typeof<string>
1096
1184
1097
1185
letcustomTransOpts=
@@ -1447,7 +1535,7 @@ type public SqlTypeProvider(config: TypeProviderConfig) as this =
1447
1535
<param name='DatabaseVendor'> The target database vendor</param>
1448
1536
<param name='IndividualsAmount'>The amount of sample entities to project into the type system for each SQL entity type. Default 50. Note GDPR/PII regulations if using individuals with ContextSchemaPath.</param>
1449
1537
<param name='UseOptionTypes'>If set, F# option types will be used in place of nullable database columns. If not, you will always receive the default value of the column's type even if it is null in the database.</param>
1450
-
<param name='ResolutionPath'>The location to look for dynamically loaded assemblies containing database vendor specific connections and custom types. Types used in desing-time: If no better clue, prefer .NET Standard 2.0 versions. Semicolon to separate multiple.</param>
1538
+
<param name='ResolutionPath'>The location to look for dynamically loaded assemblies containing database vendor specific connections and custom types. Types used in design-time: If no better clue, prefer .NET Standard 2.0 versions. Semicolon to separate multiple.</param>
1451
1539
<param name='Owner'>Oracle: The owner of the schema for this provider to resolve. PostgreSQL: A list of schemas to resolve, separated by spaces, newlines, commas, or semicolons.</param>
1452
1540
<param name='CaseSensitivityChange'>Should we do ToUpper or ToLower when generating table names?</param>
1453
1541
<param name='TableNames'>Comma separated table names list to limit a number of tables in big instances. The names can have '%' sign to handle it as in the 'LIKE' query (Oracle and MSSQL Only)</param>
0 commit comments