Convert C# logic/lambda's to T-SQL
Below is a literal translation based on your sample query and as such probably isn't the optimal solution:

IF ISNULL(@firstName, N'') = N'' OR ISNULL(@lastName, N'') = N''
    BEGIN
        SELECT  COUNT(*)
        FROM  [Services] s
            INNER JOIN .[Clients] c
                ON c.Client_Id = s.Client_Id
            INNER JOIN .[AdHoc_Referrals] r
                ON r.[Referral_Id] = s.[Referral_Id]
        WHERE r.[ReferralTypeId] = @referralTypeId
            AND s.[Service_Delivery_Type_Id] IN ({0})
            AND s.[Inital_Service_Assignment_Date] IS NOT NULL
            AND (-- This should be 'AND' to filter properly
                c.[Firstname] = @searchString 
                OR 
                c.[Surname] = @searchString
                OR 
                r.[Reference_Number] = @searchString
                )
            AND (GETDATE() &gt;= s.Inital_Service_Assignment_Date
                    AND @visitDate &lt;= DATEADD(dd, 1,
                            COALESCE(s.Actual_Discharge_Date, 
                                s.Inital_Service_Assignment_Date))
                )  
   END
ELSE
    BEGIN
        SELECT COUNT(*)
        FROM [Services] s
            INNER JOIN .[Clients] c
                ON c.Client_Id = s.Client_Id
            INNER JOIN .[AdHoc_Referrals] r
                ON r.[Referral_Id] = s.[Referral_Id]
        WHERE r.[ReferralTypeId] = @referralTypeId
            AND s.[Service_Delivery_Type_Id] IN ({0})
            AND s.[Inital_Service_Assignment_Date] IS NOT NULL
            AND ( -- Parenthesis not needed, I'm just highlighting the change
                c.[Firstname] LIKE QUOTENAME(RTRIM(@firstName) + N'%')
                AND 
                c.[Surname] = @lastName
                )
            AND (GETDATE() &gt;= s.Inital_Service_Assignment_Date
                    AND @visitDate &lt;= DATEADD(dd, 1,
                            COALESCE(s.Actual_Discharge_Date, 
                                s.Inital_Service_Assignment_Date))
                )  
    END