I have the following code in SQL Server:
ALTER PROCEDURE Checking
@name NVARCHAR(200),
@password NVARCHAR(200)
AS
Begin
SET NOCOUNT ON
DECLARE @res int
SELECT @res = COUNT(*)
FROM [User]
WHERE [User].Username = @name AND [User].PasswordHashed = HASHBYTES('SHA2_512', @password)
return @res
END
As you can see, the procedure is returning an Int32
value. In my C# code, I want to use this method using Entity Framework 6 and I have the following code:
SearchEngineEntities context = new SearchEngineEntities();
//Show the returned value by calling checking procedure in C#
How can I have the returning value of Checking procedure in C#? I have saw here and here but I was wondering if there is a direct way in Entity Framework.