예제 #1
0
        /// <summary>
        /// This method deletes a Course
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task <bool> DeleteCourse(int Id)
        {
            bool result = false;

            if (Id > 0)
            {
                var a = await CourseRepository.GetAsync(Id);

                if (a != null)
                {
                    try
                    {
                        CourseRepository.DeleteById(a);
                    }
                    catch (Exception ex)
                    {
                        throw ex;
                    }
                }
            }
            return(result);
        }
예제 #2
0
        public void DeleteCourse(int id)
        {
            CourseRepository repository = new CourseRepository();

            repository.DeleteById(id);
        }