Example function
CREATE FUNCTION ReverseCustName(@string varchar(100))
RETURNS varchar(100)
AS
BEGIN
DECLARE @custName varchar(100)
RETURN @custName
END
Then in your c# code
[Function(Name = "dbo.ReverseCustName", IsComposable = true)]
[return: Parameter(DbType = "VarChar(100)")]
public string ReverseCustName([Parameter(Name = "string",
DbType = "VarChar(100)")] string @string)
{
return ((string)(this.ExecuteMethodCall(this,
((MethodInfo)(MethodInfo.GetCurrentMethod())),
@string).ReturnValue));
}
Finally you would call your user defined function in code.
from x in exampleTable
select new {x.Column = ReverseCustName(x.Value)};
Please note this is for Linq To SQL
If you referring to EF follow this link
http://stackoverflow.com/questions/5526422/custom-sql-functions-and-code-first-ef-4-1[
^]
Please vote if this was the correct answer to your problem.
Regards, Hope you come right.