I have to define a custom function in my DB to calculate the "validity end date" of an entity. This function will be used in a stored procedure, but I need the same logic in a web app.
I'm using Linq-to-sql to connect to my DB and to map tables to classes. So I'm wondering if there is a way to reuse the function defined in my DB. I'd like to extend my entity by a partial class. Do I have to rewrite the logic in my code?
NOTE I need to use function and not stored procedure in my C# code.