public async Task <ActionResult> GetLesson(long id) { var user = long.Parse(User.Claims.First().Value); var lesson = await repository.GetLessonById(id); var link = await storage.GetPreSignedLink(lesson.Link); var metadata = await storage.GetObjectInfo(lesson.Link); var result = mapper.Map <LessonDTO>(lesson); result.Link = link ?? lesson.Link; result.Size = metadata == null ? 0 : metadata.Size; await repository.AddToHistory(user, id); return(Ok(result)); }