Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

Update Record Non-primary Key Lookup

$
0
0

Hello everyone and thanks for the help in advance.  Learning to use EF Core with a Core 3.1 controller that accepts posts from an external web api (Twilio).  The controller accepts a message id that is sent as a string along with a few other fields of data used to update an existing record in a SQL Server database.  Where I am running into problems is that the returned message id is not the primary key of the database table.  So EF requires a lookup before saving routine, however when I utilize the find method, the subsequent update requires I perform the initial lookup using the primary key rather than the message id.  So do I have to do two lookups before updating?  


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>