Please Login to Continue

Free Software Development Articles.Email List
How to Draw Realistic Photos (E-Book)

How to Draw Realistic Photos (E-Book)

$1

Why Software Development Need Ethics to Succeed (E-Book)

Why Software Development Need Ethics to Succeed (E-Book)

$1

How to Make a Social Media Website in Easy Steps

How to Make a Social Media Website in Easy Steps

$1

How to call a store procedure in Entity Framework Core 2.2.1 without a Model Generated

Problem: When working in ASP.Net Core 2.2.1, you might find yourself in need to just insert the data without going throught the trouble of updating the Models in the Data Context.

This rather a painful procedure if you don't know what you are doing, to help you resolve the problem, below is the solution. I must say that some solutions might not work with your specific problem, in this case keep on experimenting and find what works in your scenerial.

Answer:
List SqlParameter sqlParameters = new List SqlParameter();
sqlParameters.add("AddYourParameterAsShownInDB",ValueHere);
sqlParameters.add("AddYourParameterAsShownInDB",ValueHere);

_context.Database.ExecuteSqlCommand("NameOfYourStoreProc ParameterAsShownInDB, AnotherParameterAsShownInDB", ValueOfParameterOne, ValueOfParameterTwo);

Technology published
Buy Me Coffee

Was this page helpful?

Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful..



© 2020 - ErnesTech - Privacy