Created
March 4, 2012 01:50
-
-
Save crosbymichael/1969911 to your computer and use it in GitHub Desktop.
ZenORM C# Framework
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
config = ZenOrmConfig.Instance; | |
config.DataStore = DataStoreType.MySQL; | |
config.DataStoreConfig = new ZenORM.Config.MySqlConfig(); | |
config.Debug = true; | |
Video video = new Video { | |
Director = "Steven", | |
NumberOfCast = 30, | |
Title = "ET", | |
Id = 848//This will be auto assigned by database when not in debug mode | |
}; | |
video.Init(); | |
video.Save(); | |
var newVideo = Video.Find(848).FirstOrDefault(); | |
video.Title = "Indiana Jones"; | |
video.Save(); | |
video.Delete(); | |
INSERT INTO Video (Director,Title,NumberOfCast,Id) VALUES ('Steven','ET',30,848); | |
SELECT * FROM Video WHERE Id=848; | |
UPDATE Video SET Director='Steven', Title='Indiana Jones', NumberOfCast=30 WHERE Id=848; | |
DELETE FROM Video WHERE Id=848; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment