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

                repository.BulkDelete(arrayIds);

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