public async Task <Visit> VisitSlide(string courseId, Guid slideId, string userId) { if (string.IsNullOrEmpty(userId)) { return(null); } await visitsRepo.AddVisit(courseId, slideId, userId, GetRealClientIp()); return(visitsRepo.FindVisit(courseId, slideId, userId)); }
public async Task <Visit> VisitSlide(string courseId, string slideId) { if (!User.Identity.IsAuthenticated) { return(null); } var userId = User.Identity.GetUserId(); await visitsRepo.AddVisit(courseId, slideId, userId); return(visitsRepo.GetVisiter(slideId, userId)); }