protected override bool RunInBackground(params SmsData[] @params) { var messageDataList = @params.AsEnumerable().Select((x) => { var ts = TimeSpan.FromMilliseconds(x.Timestamp); var timestamp = new DateTime(1970, 1, 1); var messageTime = timestamp.Add(ts).ToLocalTime(); return(new MessageData() { Sender = x.PhoneNumber, Body = x.Body, Timestamp = messageTime }); }); PublishProgress(messageDataList.ToArray()); _db.Insert(messageDataList); return(true); }