extend the plattform service with a GetCities function

This commit is contained in:
Andreas Zweili 2018-08-30 19:59:49 +02:00
parent efc600b433
commit a849911345
2 changed files with 16 additions and 0 deletions

View File

@ -6,6 +6,7 @@ using System.ServiceModel;
using System.Text;
using Plattform.DB;
using Plattform.Models;
using Plattform.AirlineService;
namespace Plattform
{
@ -27,5 +28,7 @@ namespace Plattform
List<Gender> GetGenders();
[OperationContract]
List<Salutation> GetSaluations();
[OperationContract]
List<City> GetCities();
}
}

View File

@ -103,5 +103,18 @@ namespace Plattform
return new List<Salutation>();
}
}
public List<City> GetCities()
{
CityDB cityDB = new CityDB();
try
{
return cityDB.GetAllCities();
}
catch(Exception e)
{
System.Diagnostics.Trace.WriteLine(e);
return new List<City>();
}
}
}
}