input: Write a function to load a JSON fixture file, extract properties from it, create Property objects from the properties, and save them to the database. The function should take the base path as an argument and return the number of objects saved. If the fixture file is empty or the 'properties' key is missing, the function should handle these cases appropriately.
  assert main("path/to/fixture") == 3
  assert main("path/to/empty/fixture") == 0
  assert main("path/to/missing/properties/fixture") == 0
output: def main(base_path):
      import json
      from pathlib import Path
      from my_module import Property, save_to_db
  
      fixture_path = Path(base_path) / "fixture.json"
      
      try:
          with open(fixture_path, 'r') as file:
              data = json.load(file)
      except (FileNotFoundError, json.JSONDecodeError):
          return 0
      
      if not data or 'properties' not in data:
          return 0
      
      properties = data['properties']
      property_objects = [Property(**prop) for prop in properties]
      
      for prop in property_objects:
          save_to_db(prop)
      
      return len(property_objects)