c# - Execute UpdateAsync and DeleteAsync with WHERE clause in SQLite-net -
I am using the following libraries in my project:
I looked at the document and I could not find any How to do UpdateAynyn
or DeleteAsync
with a WHERE
clause, for example, in a gate method it looks like this:
Wait sqlConnection.Table & lt; MyTable & gt; (). Where (v = & gt; v.Type.Equals (type)). ToListAsync (). ([T] => {...}
However, with UpdateAsync
or DeleteAsync
From where do not there with the method. So far, I am using the query and handing the query in hand, but there is no point like this because I am using an ORM for this purpose, And I'm talking about something like an update or a command. Any thoughts on this?
maybe You can try to do something like this:
var current user = wait db.FindAsync & lt; user & gt; (u = & gt; u.UserName == user.UserName ); If (Existing user! = Null) {wait db.UpdateAsync (user);}
(Where the user name is the primary key of my user table.)
< / Div>
Comments
Post a Comment