Esempio n. 1
0
        public IActionResult Create([FromBody] SignIn signIn)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            return(Ok(_iRepo.CreateSignIn(signIn)));
        }
        public IActionResult Create([FromBody] SignInViewModel signInViewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            SignIn signIn = new SignIn();

            signIn.PersonId   = signInViewModel.PersonId;
            signIn.SemesterId = signInViewModel.SemesterId;
            signIn.Tutoring   = signInViewModel.Tutoring;
            signIn.InTime     = DateTime.Now;

            List <Course> courses = signInViewModel.Courses;
            List <Reason> reasons = signInViewModel.Reasons;

            return(Ok(_iRepo.CreateSignIn(signIn, courses, reasons)));
        }