Closed p-ideal closed 7 years ago
Yes, in fact you don't need Entity Framework for this at all. All you need is the IDbConnection
object, which you can easily construct from a connection string. For SQL Server, for instance, this is a SqlConnection
. Here is how I generally create them:
IDbConnection connection = new SqlConnection(
ConfigurationManager.ConnectionStrings["MyDatabase"].ConnectionString);
Not Working in Mysql:
This is what I am doing
IDbConnection connection = context.Database.Connection;
connection.Execute().sp_dummy(id: inID);
Getting Exception:
Procedure or function '[sp_dummy]
' cannot be found in database '[xxx]
'.
where xxx is my schema
I think it is using SQL Server syntax to fetch data from database such as [SchemaName][DatabaseName] and MySql does not use '[' or ']' brackets.
Let me know if you need any info from my side.
@p-ideal this is the same bug as #87. I've added support, but messed up the way to expose set it. I should have this fixed tonight.
@p-ideal, to call them in MySQL, before making any database calls, call the configuration method:
StoredProcedure.SetObjectQuoteStyle(ObjectQuoteStyle.Backtick);
This will only work with 2.3.0-pre05 and up, however.
Can I use CodeOnlyStoredProcedures in database first approch to execute stored procedure? If yes then how can I do it.Please let me ASAP. Thanks in advance.