Last active
December 17, 2015 20:19
-
-
Save bhameyie/5666712 to your computer and use it in GitHub Desktop.
Simple.data sample inserts & delete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Inserting a story | |
var database = Database.OpenConnection(m_connectionString); | |
var result = database.Stories.Insert(entity); //This doesn’t save the Project or Tasks associated with the story. The result being return is the saved object with an updated Id. | |
//updating | |
var inserted = database.Stories.Update(entity); | |
//sample update all | |
database.Stories.UpdateAll(Title: "Glorious"); | |
database.Stories.UpdateAll(database.Stories.Estimate > 10, Title: “Break me down into multiple smaller stories"); | |
//Deleting | |
database.Stories.DeleteAll(database.Stories.Estimate > 50); | |
database.Stories.DeleteById(id); | |
//I’m a baller. I don’t need stories | |
database.Stories.DeleteAll(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment