public string modify(int id, string name, string waterType) { // A constant for error message. Avoids a magic value. const string NAME_IS_EMPTY_MSG = "Fish name must have a value"; const string WATER_TYPE_IS_EMPTY_MSG = "Fish must have a water type"; // Trim any leading or trailing blanks name = name.Trim(); // Make sure it is not empty if (String.IsNullOrEmpty(name)) { return(NAME_IS_EMPTY_MSG); } waterType = waterType.Trim(); if (String.IsNullOrEmpty(waterType)) { return(WATER_TYPE_IS_EMPTY_MSG); } FishStore fishStore = new FishStore(); return(fishStore.modify(id, name, waterType)); }
public string waterByFishName(string name) { FishStore fishStore = new FishStore(); return(fishStore.getFishByName(name).getWater()); }
public List <Fish> getAll() { FishStore fishStore = new FishStore(); return(fishStore.getAll()); }