BuildFeed/Tools/MongoTimeChecker/Program.cs
2016-07-15 12:17:30 +01:00

39 lines
1.0 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using MBuildModel = RedisMongoMigration.Mongo.BuildModel;
using MBuild = RedisMongoMigration.Mongo.Build;
using RBuild = RedisMongoMigration.Redis.Build;
namespace MongoTimeChecker
{
class Program
{
static void Main(string[] args)
{
var builds = RBuild.Select();
MBuild mBuildObj = new MBuild();
foreach (var build in builds)
{
var mBuild = mBuildObj.SelectByLegacyId(build.Id);
if(mBuild != null)
{
bool isSame = mBuild.BuildTime == build.BuildTime;
if(!isSame)
{
Console.WriteLine($"{build.FullBuildString}: {build.BuildTime} != {mBuild.BuildTime}");
DateTime dt = DateTime.SpecifyKind(build.BuildTime.Value, DateTimeKind.Utc);
mBuildObj.UpdateDateOfLegacy(build.Id, dt);
}
}
}
Console.ReadKey();
}
}
}