Пример #1
0
        public async Task <ActionResult> Create(Attendance attendace)
        {
            if (ModelState.IsValid)
            {
                await _attendanceService.CreateAttendance(attendace);

                return(RedirectToAction(nameof(Index)));
            }
            return(View(attendace));
        }
Пример #2
0
        public ActionResult <int> CreateAttendance(Attendance attendance)
        {
            //attendance.AplicationUserId = User.FindFirst(ClaimTypes.NameIdentifier).Value;

            try
            {
                attendanceService.CreateAttendance(attendance);
                return(Ok());
            }
            catch (Exception ex)
            {
                return(BadRequest(ex));
            }
        }