Exemplo n.º 1
0
        public async Task <IActionResult> Subcribe(int id)
        {
            var subject = await _subjectManager.GetSubjectAsync(id);

            if (subject == null)
            {
                return(NotFound());
            }

            var user = await GetCurrentUser();

            await _subjectManager.SubcribeAsync(new ClassRoomSubject()
            {
                ClassRoomId = user.ClassRoomId,
                SubjectId   = id
            });

            return(Ok());
        }