I have class Country which has collections of Cities.
At client I use webmethod
[WebMethod]
public void AddCity(string countryCode,string name)
{
MyFacade.AddCity(countryCode,name);
}
at Facade I have method
public void AddCity(string countryCode,string name)
{
Country.AddCity(countryCode,name); <-in this method is simple sql operation
}
and the core of my question:
public class Country
{
public static void AddCity(string countryCode, string cityName)
{
//insert into table cities new city
}
}
It's ok? Or I must create objectCountry, and there have non static method AddCity?
And another question:
Better use:
City[] cities= Country.GetAllCities(countryCode)
or
City[] cities= new Country(countryCode).GetAllCities()