예제 #1
0
        public async Task <IHttpActionResult> DeleteById(string id)
        {
            if (string.IsNullOrEmpty(id) || !Guid.TryParse(id, out var _))
            {
                return(BadRequest());
            }

            var result = await _courseService.DeleteByIdAsync(id);

            return(result.IsError ? BadRequest(result.Message) : (IHttpActionResult)Ok(result.Data));
        }