Created
May 7, 2013 12:35
-
-
Save Dynalon/5532235 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 System; | |
using ServiceStack.OrmLite; | |
using System.IO; | |
namespace ormlitebug | |
{ | |
class MainClass | |
{ | |
public static void Main (string[] args) | |
{ | |
var factory = new OrmLiteConnectionFactory ("sqlite.db", SqliteDialect.Provider); | |
using (var db = factory.OpenDbConnection ()) { | |
db.DropAndCreateTable<SamplePoco> (); | |
var toDb = new SamplePoco () { TheTime = new DateTime (1990, 1, 1, 0, 0, 0, DateTimeKind.Utc) }; | |
db.Insert<SamplePoco> (toDb); | |
var fromDb = db.Select<SamplePoco> ()[0]; | |
var fromDbUtc = fromDb.TheTime.ToUniversalTime (); | |
var toDbUtc = toDb.TheTime.ToUniversalTime (); | |
if (fromDbUtc != toDbUtc) | |
throw new Exception (); | |
} | |
} | |
} | |
public class SamplePoco | |
{ | |
public DateTime TheTime { get; set; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment