oop_NFS_Andreas/Plattform/Plattform/Models/Flight.cs

38 lines
1.1 KiB
C#
Raw Normal View History

2018-08-19 14:31:58 +02:00
using System;
using System.Runtime.Serialization;
2018-08-21 22:26:29 +02:00
using Plattform;
2018-08-19 14:31:58 +02:00
namespace Plattform.Models
{
[DataContract]
public class Flight
{
[DataMember]
public int FlightID { get; set; }
[DataMember]
2018-08-21 21:03:30 +02:00
public virtual Airline Airline { get; set; }
2018-08-19 14:31:58 +02:00
[DataMember]
public string Name { get; set; }
[DataMember]
public DateTime StartTime { get; set; }
[DataMember]
public float Duration { get; set; }
[DataMember]
2018-08-21 21:03:30 +02:00
public virtual Airport Origin { get; set; }
2018-08-19 14:31:58 +02:00
[DataMember]
2018-08-21 21:03:30 +02:00
public virtual Airport Destination { get; set; }
2018-08-19 14:31:58 +02:00
2018-08-21 22:26:29 +02:00
public Flight(AirlineService.Flight flight)
2018-08-19 14:31:58 +02:00
{
2018-08-21 22:26:29 +02:00
Airport origin = new Airport(flight.Origin);
Airport destination = new Airport(flight.Destination);
2018-08-19 14:31:58 +02:00
this.Airline = new Airline(flight.Airline);
this.Name = flight.Name;
this.StartTime = flight.StartTime;
this.Duration = flight.Duration;
2018-08-21 22:26:29 +02:00
this.Origin = origin;
this.Destination = destination;
2018-08-19 14:31:58 +02:00
}
}
}