public void Migrate() { var forRoles = SourceDbContext.ForRoles.ToList(); foreach (var forRole in forRoles) { var newEntity = new SignedForGameRole() { Id = _signedForGameRoleKeyMapper.MapKey(forRole.Id), GameRole = StringToGameRole.Convert(forRole.Role), SignUpId = _signUpKeyMapper.MapKey(forRole.SignUpId) }; TargetDbContext.SignedForGameRoles.Add(newEntity); } TargetDbContext.SaveChanges(); }
public void Migrate() { var playsRoles = SourceDbContext.PlaysRoles.ToList(); foreach (var playsRole in playsRoles) { var newEntity = new PlaysGameRole() { Id = _playsGameRoleKeyMapper.MapKey(playsRole.Id), FromTime = playsRole.FromTime, EndTime = playsRole.EndTime, GameRole = StringToGameRole.Convert(playsRole.Role), GameCharacterClaimId = _gameCharacterClaimKeyMapper.MapKey(playsRole.CharacterClaimId) }; TargetDbContext.PlaysGameRoles.Add(newEntity); } TargetDbContext.SaveChanges(); }