I have this TSQL code...
Code: Select all
ALTER PROCEDURE [dbo].[PROC_Præmier_script_hent_perioder]
@gruppeID UNIQUEIDENTIFIER,
@policetypeID UNIQUEIDENTIFIER,
@fællespoliceID UNIQUEIDENTIFIER
AS
BEGIN
SET NOCOUNT ON;
IF @fællespoliceID IS NULL
BEGIN
SELECT DISTINCT periode_fra, periode_til
FROM dbo.TTYP_Præmier_script
WHERE (slettet_dato IS NULL) AND
(gruppe_ID=@gruppeID) AND
(policetype_ID=@policetypeID) AND
(fællespolice_ID IS NULL)
ORDER BY periode_til DESC
END
ELSE
BEGIN
SELECT DISTINCT periode_fra, periode_til
FROM dbo.TTYP_Præmier_script
WHERE (slettet_dato IS NULL) AND
(fællespolice_ID=@fællespoliceID)
ORDER BY periode_til DESC
END
END
Code: Select all
<FunctionAttribute(Name:="dbo.PROC_Præmier_script_hent_perioder")>
<ResultType(GetType(PROC_Præmier_script_hent_perioderResult))>
<ResultType(GetType(PROC_Præmier_script_hent_perioderResult1))>
Public Function PROC_Præmier_script_hent_perioder(<Parameter(Name:="gruppeID", DbType:="UNIQUEIDENTIFIER")> gruppeID As System.Guid?, <Parameter(Name:="policetypeID", DbType:="UNIQUEIDENTIFIER")> policetypeID As System.Guid?, <Parameter(Name:="fællespoliceID", DbType:="UNIQUEIDENTIFIER")> fællespoliceID As System.Guid?) As System.Data.Linq.IMultipleResults
Dim _PROC_Præmier_script_hent_perioderResult As IExecuteResult = Me.ExecuteMethodCall(Me, CType(MethodInfo.GetCurrentMethod(), MethodInfo), gruppeID, policetypeID, fællespoliceID)
Return CType(_PROC_Præmier_script_hent_perioderResult.ReturnValue, System.Data.Linq.IMultipleResults)
End Function