Example #1
0
        private void ValidateMaintenanceIfNotExist(MaintenanceModel MaintenanceModel)
        {
            var existingEntity = _MaintenanceRepository.GetByIdAsync(MaintenanceModel.ID);

            if (existingEntity == null)
            {
                throw new ApplicationException($"{MaintenanceModel.ToString()} with this id is not exists");
            }
        }
Example #2
0
        private async Task ValidateMaintenanceIfExist(MaintenanceModel MaintenanceModel)
        {
            var existingEntity = await _MaintenanceRepository.GetByIdAsync(MaintenanceModel.ID);

            if (existingEntity != null)
            {
                throw new ApplicationException($"{MaintenanceModel.ToString()} with this id already exists");
            }
        }