示例#1
0
        public IActionResult BulkDelete(string ids)
        {
            try
            {
                var arrayIds = ids.Split(",");
                if (arrayIds.Length == 0)
                {
                    return(BadRequest(Constants.ErrorMessages.NoEntityOnDelete));
                }

                repository.Delete(arrayIds);

                return(Ok(Constants.ErrorMessages.DeleteSucess(arrayIds.Count())));
            }
            catch (Exception ex)
            {
                logger.LogError(ex.GetExceptionMessages());
                return(StatusCode(StatusCodes.Status500InternalServerError, Constants.ErrorMessages.DeleteError));
            }
        }