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
update {for p in peopleService.Table domatch person.FirstName
| Some firstName -> setColumn p.FirstName firstname
| None ->()
where (p.Id = id)}
Gives me an error:
A custom operation may not be used in conjunction with 'use', 'try/with', 'try/finally', 'if/then/else' or 'match' operators within this computation expressionF# Compiler[3086](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-messages/fs3086)
Similarly, trying to use an if operator gives me this error: This control construct may only be used if the computation expression builder defines a 'Zero' methodF# Compiler[708](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-messages/fs0708)
It would be great to be able to match in the update CE for the purpose of accepting a Partial DTO and only setting columns for those fields which have Some value.
The text was updated successfully, but these errors were encountered:
The query expressions have a fairly narrow band of acceptable syntax. Match statements are not handled.
This is because the code in the query isn’t executed directly. Rather, it is just reading the code structures and converting them into a SQL string on your behalf.
Think of it as a strongly typed way to create a SQL command.
If you want to be able to conditionally set a field, you could fairly easily create a “setIf” extension method / custom operation that also takes a bool condition parameter.
Gives me an error:
A custom operation may not be used in conjunction with 'use', 'try/with', 'try/finally', 'if/then/else' or 'match' operators within this computation expressionF# Compiler[3086](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-messages/fs3086)
Similarly, trying to use an
if
operator gives me this error:This control construct may only be used if the computation expression builder defines a 'Zero' methodF# Compiler[708](https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/compiler-messages/fs0708)
It would be great to be able to match in the update CE for the purpose of accepting a Partial DTO and only setting columns for those fields which have Some value.
The text was updated successfully, but these errors were encountered: