I have run into what seems like an error with either PostgreSQL or the Devart database connection library. The following is a simple test app I created:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DateTimeOffsetTest
{
class Program
{
static void Main(string[] args)
{
using (var context = new Context())
{
var e = new Ent() { CreatedOn = DateTimeOffset.Now };
Console.WriteLine(e.CreatedOn.UtcDateTime.Ticks);
context.Ents.Add(e);
context.SaveChanges();
}
using (var context = new Context())
{
var ent = context.Ents.Single();
Console.WriteLine(ent.CreatedOn.UtcDateTime.Ticks);
Console.Read();
context.Ents.Remove(ent);
context.SaveChanges();
}
}
}
}
I would expect that the two lines being written to the console would be the same, but the second one always has a 0 in the last digit. Example:
Is this a precision issue with the way PostgreSQL is setup and if so, can I change that somehow? This test works fine if I am using SqlServer as my database.