public bool UpdateCustomerId(string business_id, string thread_id) { var t = _threadRepository.GetById(business_id, thread_id); var user_id = FacebookConversationService.GetUniqueUserId(t.owner_avatar, t.owner_ext_id, t.owner_app_id); if (!string.IsNullOrWhiteSpace(user_id)) { _threadRepository.UpdateCustomerId(business_id, t.id, user_id); return(true); } return(false); }
public int UpdateCustomerId(string business_id, int limit) { int count = 0; foreach (var t in _threadRepository.GetThreadsWhereCustomerIsNull(business_id, new Paging { Limit = limit }).Result) { var user_id = FacebookConversationService.GetUniqueUserId(t.owner_avatar, t.owner_ext_id, t.owner_app_id); if (!string.IsNullOrWhiteSpace(user_id)) { count++; _threadRepository.UpdateCustomerId(business_id, t.id, user_id); } } return(count); }