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
This issue follow this one #21039, but focus on the call on the scalar functions
On the same way, how I can call a scalar function directly? I only find example when its use inside entity request but not from outside ? (with the DbFunction attribute)
If i take back my example
CREATE FUNCTION [dbo].[FnGetNbMessages](@DestId int, @EtsId tinyint, @Statut tinyint)
RETURNS int
AS
BEGIN
return ISNULL(
(
SELECT Count(Id)
FROM [Messages] Msg
LEFT JOIN GrpDests_Users Dg on DG.GrpNum = Msg.DestGrpNum AND DG.UserID = @DestId
WHERE
--DestUserID = @DestId AND (EtsID IS NULL OR EtsID = @EtsId) AND (@Statut IS NULL OR Statut = @Statut)
(@EtsId IS NULL OR Msg.EtsID is NULL OR Msg.EtsID = @EtsId)
AND (DestUserID = @DestId OR DG.UserID IS NOT NULL)
AND (@Statut IS NULL OR Statut = @Statut)
), 0)
END;
I try
var result = this.Set<IntReturn>().FromSqlRaw("select dbo.FnGetNbMessages(@p0, @p1, @p2)", destinataireId, etsId, statut)
.AsEnumerable().FirstOrDefault()?.Nb ?? 0;
but without success (and it seem i can't put "as Nb" in the scalar function)
thanks !
The text was updated successfully, but these errors were encountered:
This issue follow this one #21039, but focus on the call on the scalar functions
On the same way, how I can call a scalar function directly? I only find example when its use inside entity request but not from outside ? (with the DbFunction attribute)
If i take back my example
I try
but without success (and it seem i can't put "as Nb" in the scalar function)
thanks !
The text was updated successfully, but these errors were encountered: