示例#1
0
        public async Task <bool> DeleteTrainingAsync(Guid TrainingId)
        {
            var deleteCampaign = await _ctx.Trainings.FirstOrDefaultAsync(c => c.TrainingId == TrainingId);

            _ctx.Remove(deleteCampaign);
            try {
                return(await _ctx.SaveChangesAsync() > 0 ? true : false);
            } catch (System.Exception ex) {
                throw new Exception($"{ex.Message}");
            }
        }