Created
February 14, 2012 19:54
-
-
Save lancscoder/1829694 to your computer and use it in GitHub Desktop.
Dapper Going Further
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
using (var connection = MvcApplication.GetOpenConnection()) { | |
connection.Delete<Post>( new Post { ID = 1 } ); | |
} |
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
using ( var connection = MvcApplication.GetOpenConnection() ) { | |
connection.Insert<Post( | |
new Post { Title = "Title 1", Text = "Text 1", | |
PublishDate = DateTime.Now }); | |
} |
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
using (var connection = MvcApplication.GetOpenConnection()) { | |
var post = connection.Get<Post>(1); | |
} |
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
using (var connection = MvcApplication.GetOpenConnection()) { | |
connection.Update<Post>( | |
new Post { ID = 1, Title = "New Title ", | |
Text = "Text 1", PublishDate = DateTime.Now }); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment