vendredi 20 novembre 2015

WCF Test Client not displaying saved data from database

I have created a database with details of a car. I have to test the database using the WCF Test client. Once I input a car ID and invoke, it will not display my data from the table. Only null values. Here is my code for the service class. Why will my saved data from my table not display?

public class CarService : ICarService
{

    public Car GetCar(int id)
    {
        CarBDO carBDO = new CarBDO();
        Car car = new Car();
        TranslateCarBDOToCarDTO(carBDO, car);
        return car;
     }



    private void TranslateCarBDOToCarDTO(CarBDO carBDO, Car car)
    {
        car.CarID = carBDO.CarID;
        car.CurrentOwner = carBDO.CurrentOwner;
        car.DateFirstRegistered = carBDO.DateFirstRegistered;
        car.SornStatus = carBDO.SornStatus;
        car.Colour = carBDO.Colour;
        car.EngineSize = carBDO.EngineSize;
        car.YearofManufacture = carBDO.YearofManufacture;
        car.DateTaxed = carBDO.DateTaxed;
        car.Make = carBDO.Make;
        car.Model = carBDO.Model;   
    }

Below is the image of how the Test client looks when I invoke a car ID

Aucun commentaire:

Enregistrer un commentaire