public async Task <StudentExtraHoursModel> CreateStudentExtraHours(StudentExtraHoursModel data, IPrincipal currentUser)
        {
            var claims = ((ClaimsIdentity)currentUser.Identity).Claims;

            data.UserRole            = claims.First(x => x.Type.Contains("role")).Value;
            data.UserCreatedUniqueId = claims.First(x => x.Type.Contains("person_unique_id")).Value;
            data.UserFirstName       = claims.First(x => x.Type.Contains("firstname")).Value;
            data.UserLastSurname     = claims.First(x => x.Type.Contains("lastsurname")).Value;

            var newEntity = MapStudentExtraHoursModelToStudentExtraHoursEntity(data);

            var entity = await _commands.CreateStudentExtraHours(newEntity);

            return(MapStudentExtraHoursEntityToStudentExtraHoursModel(entity));
        }
        private Persistence.Models.StudentExtraHours MapStudentExtraHoursModelToStudentExtraHoursEntity(StudentExtraHoursModel model)
        {
            if (model == null)
            {
                return(null);
            }

            return(new Persistence.Models.StudentExtraHours
            {
                StudentExtraHoursId = model.StudentExtraHoursId,
                Version = model.Version,
                StudentUniqueId = model.StudentUniqueId,
                GradeLevel = model.GradeLevel,
                FirstName = model.FirstName,
                LastSurname = model.LastSurname,
                Date = model.Date,
                Hours = model.Hours,
                UserCreatedUniqueId = model.UserCreatedUniqueId,
                UserRole = model.UserRole,
                CreateDate = model.CreateDate,
                UserLastSurname = model.UserLastSurname,
                UserFirstName = model.UserFirstName,
                SchoolYear = model.SchoolYear,
                ReasonId = model.ReasonId,
                Reason = MapReasonModelToEntity(model.Reason),
                Comments = model.Comments,
                Id = model.Id
            });
        }