private string EnsureCurrentWorker(AttendanceLog log) { var workerId = _db.GetWorkerIdByEnrollNumberAndProjectId(log.UserId, log.ProjectId); if (!string.IsNullOrWhiteSpace(workerId)) { return(workerId); } //request workerId = _web.FindProjectWorkerByFaceId(log.ProjectId, log.UserId).GetAwaiter().GetResult(); if (!string.IsNullOrWhiteSpace(workerId)) { _db.AddWorker(new WorkerInfo { UserId = workerId, EnrollNumber = log.UserId, ProjectId = log.ProjectId }); return(workerId); } return(string.Empty); }