Repository navigation
Conversation
5765a08 to
2dbd6a0
Compare
47daaa5 to
1441d2c
Compare
roji
left a comment
There was a problem hiding this comment.
Pedantic English review FTW! Feel free to ignore points if disagree.
BTW see build warnings in the CI checks.
smitpatel
left a comment
There was a problem hiding this comment.
Also add
- The HasFunction overload which takes lambda with default params to register a function
- DbFunctionAttribute and properties over that.
- Specifying a schema or marking function as built-in
- Mapping function return type or parameter to particular store type when not natively supported and scenario where it works.
- argument propagates nullability API and link to the null semantics docs.
- Ideally, we should put down the example of mapping to JSON function dotnet/efcore#11295 (comment) Probably most used usecase for the UDF so far
- Mention that TVF cannot use HasTranslation API
- Few more cautions about HasTranslation API and need to understand the SQL expression tree.
f940be5 to
f8c0098
Compare
51b5370 to
1ba91a4
Compare
| args.First(), | ||
| args.Skip(1).First(), | ||
| typeof(bool), | ||
| new SqlServerBoolTypeMapping("bit")), |
There was a problem hiding this comment.
Consider translating to ABS(a - b) to avoid this warning and also give example of SqlFunctionExpression translation.
There was a problem hiding this comment.
ended up going with slightly more complicated translation to both show the SqlFunction and custom specification of type mappings - should we add a note/caution that this is an advanced scenario?
f3d503c to
0f8f1c6
Compare
|
|
||
| #region HasTranslationFunctionConfiguration | ||
| // 100 * ABS(first - second) / ((first + second) / 2) | ||
| var doubleTypeMapping = new SqlServerDoubleTypeMapping("float"); |
There was a problem hiding this comment.
You can avoid type mapping and associated warning if you make first/second double in C# and just reuse their type mapping.
There was a problem hiding this comment.
don't we want to show people how to create the mapping themselves? like when you divide/multiply by a double constant, you would have to do it anyway no?
Fixes #500