DatabaseConnectionInsertOrReplaceT Method |
Inserts an object into the database, replacing the existing entry if the primary key already exists.
Namespace: SQLitePCL.pretty.OrmAssembly: SQLitePCL.pretty.Orm (in SQLitePCL.pretty.Orm.dll) Version: 1.0.0.0 (1.0.0)
Syntax public static T InsertOrReplace<T>(
this IDatabaseConnection This,
T obj,
Func<IReadOnlyList<IResultSetValue>, T> resultSelector
)
[<ExtensionAttribute>]
static member InsertOrReplace :
This : IDatabaseConnection *
obj : 'T *
resultSelector : Func<IReadOnlyList<IResultSetValue>, 'T> -> 'T
Parameters
- This
- Type: SQLitePCL.prettyIDatabaseConnection
The database connection. - obj
- Type: T
The object to insert. - resultSelector
- Type: SystemFuncIReadOnlyListIResultSetValue, T
A transform function to apply to each row.
Type Parameters
- T
- The mapped type.
Return Value
Type:
TThe object inserted into the database including it's primary key.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IDatabaseConnection. When you use instance method syntax to call this method, omit the first parameter. For more information, see
Extension Methods (Visual Basic) or
Extension Methods (C# Programming Guide).
See Also