Ejemplo n.º 1
0
        public IApartmentStorage CreateApartmentStorage(ApartmentStorageEnum type)
        {
            IApartmentStorage result = null;

            if (!Enum.IsDefined(typeof(ApartmentStorageEnum), type))
            {
                throw new ArgumentException("Unhandled ApartmentStorageEnum value");
            }

            switch (type)
            {
            case ApartmentStorageEnum.CSV:
            {
                result = new CsvApartmentStorage(GetConnectionString(type));
                break;
            }

            case ApartmentStorageEnum.SQL:
            {
                result = new SqlApartmentStorage(GetConnectionString(type));
                break;
            }

            case ApartmentStorageEnum.SQLite:
            {
                result = new SqliteApartmentStorage(GetConnectionString(type));
                break;
            }

            default:
            {
                throw new NotImplementedException("Unsupported ApartmentStorageEnum value.");
            }
            }

            return(result);
        }
Ejemplo n.º 2
0
 public void SetApartmentStorage(IApartmentStorage _apartmentStorage)
 {
     apartmentStorage = _apartmentStorage;
 }
Ejemplo n.º 3
0
 public ApartmentStorage(IApartmentStorage _apartmentStorage)
 {
     apartmentStorage = _apartmentStorage;
 }