I want to create some user-defined functions using code first approach in abp framework.
I have created stored procedures xyz by adding xyz.sql inside EntityFrameworkCore\Migrations\Stored Procedures folder, But not able to find a way to create a function, please help.
7 Answer(s)
-
0
Hi,
We have a CodeProject article about that.
<a class="postlink" href="https://www.codeproject.com/Articles/1199648/Using-Stored-Procedure-User-Defined-Function-and-V">https://www.codeproject.com/Articles/11 ... tion-and-V</a>
-
0
Hi yekalkan,
this article is about how to call SP and user-defined functions from C# code. But my question is different. I want to create user defined function using code first approach.
I'm able to create stored procedures using code first approach but not able to create UDF.
So basically I want to create UDF and add it to a migration. like we do for tables and stored procedures.
-
0
Hi @ManojReddy,
This is directly related to EF I think. You can check it on the web or ask it on EF github repository.
-
0
Hi @ismcagdas,
Thanks for your suggestion, I have posted my query in EF github repo, It would be a great help if in meanwhile your team can provide the solution or any hint.
Thanks
-
0
Hi @ManojReddy,
I'm not sure if this works but you can give it a try.
Run Add-Migration command to create an empty migration. Then you can execute sql command in this migration to create a UDF.
-
0
I have posted my answer here, please check it might help somebody.
[https://stackoverflow.com/a/48268866/6527049])
-
0
Thanks @ManojReddy :)