public async Task <bool> UpdateAsync(UserClassDTO entity)
        {
            var entityDb = await _userClassRepository.GetByIdAsync(entity.Id);

            entityDb.Id   = entity.Id;
            entityDb.Name = entity.Name;

            return(await _userClassRepository.UpdateAsync(entityDb));
        }
        public async Task CreateAsync(UserClassDTO entity)
        {
            UserClass dbEntity = new UserClass()
            {
                Id   = entity.Id,
                Name = entity.Name
            };

            await _userClassRepository.CreateAsync(dbEntity);
        }
        public async Task <IActionResult> UpdateAsync([FromRoute] Guid id, [FromBody] UserClassDTO entity)
        {
            var updated = await _userClassService.UpdateAsync(entity);

            if (updated)
            {
                return(Ok(entity));
            }
            return(NotFound());
        }
        public async Task <UserClassDTO> GetByIdAsync(Guid id)
        {
            UserClass fromDb = await _userClassRepository.GetByIdAsync(id);

            UserClassDTO entityDb = new UserClassDTO()
            {
                Id   = fromDb.Id,
                Name = fromDb.Name
            };

            return(entityDb);
        }
        private UserClassDTO MapToDTO(UserClassModel ucm)
        {
            UserClassDTO ucDTO = new UserClassDTO()
            {
                UserId    = ucm.UserId,
                ClassId   = ucm.ClassId,
                UserName  = ucm.UserName,
                ClassName = ucm.ClassName,
                ClassDate = ucm.ClassDate
            };

            return(ucDTO);
        }
        public async Task <IActionResult> CreateAsync(UserClassDTO entity)
        {
            await _userClassService.CreateAsync(entity);

            return(Ok());
        }