public async Task <IActionResult> Edit(int?id)
        {
            if (id == null)
            {
                return(RedirectToAction(nameof(Error), new { message = "Id is null" }));
            }
            var obj = await _serviceLecture.FindByIdAsync(id.Value);

            if (obj == null)
            {
                return(RedirectToAction(nameof(Error), new { message = "Id not found" }));
            }


            LectureFormViewModel view = new LectureFormViewModel {
                lecture = obj
            };

            return(View(view));
        }