SHARE
TWEET

Untitled

a guest Jul 24th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Fleetdata Entity
  2.     public class Fleetdata : EntityObject
  3.     {
  4.       public string Ad_Ma { get; set; }
  5.       public string Id_Ma { get; set; }
  6.       public string CustomerNr { get; set; }
  7.       public string First_Delivery { get; set; }
  8.       public bool Want_Key { get; set; }
  9.       public bool Rb_Change { get; set; }
  10.       public bool Pallet_Delivery { get; set; }
  11.       public string Name { get; set; }
  12.       public string Company_Name { get; set; }
  13.       public string Street_HouseNr { get; set; }
  14.    public string Postalcode_Place { get; set; }
  15.    public string Phone { get; set; }
  16.    public string Mobilephone { get; set; }
  17.    public string Fax { get; set; }
  18.    public string Email { get; set; }
  19.    public string Important_Infos { get; set; }
  20.    public bool Delivery_After { get; set; }
  21.    public string Delivery_Point { get; set; }
  22.    public string Delivery_Time_Window { get; set; }
  23.    public List<FleetdataRestday> Rest_Days { get; set; } = new
  24.    List<FleetdataRestday>();
  25.    public List<FleetdataDeliveryday> Deliverydays { get; set; } = new
  26.    List<FleetdataDeliveryday>();
  27. }
  28.  
  29.  
  30.  
  31. //Delivery_Day Entity
  32. public class Delivery_Day : EntityObject
  33. {
  34.     public string Weekday { get; set; }
  35.     public List<FleetdataDeliveryday> Fleetdatas { get; set; } = new
  36.     List<FleetdataDeliveryday>();
  37. }
  38.  
  39.  
  40.  
  41.  
  42. //Associative table
  43. public class FleetdataDeliveryday
  44. {
  45.     public int FleetdataId { get; set; }
  46.     public int DeliveryDayId { get; set; }
  47.     public Fleetdata Fleetdata { get; set; }
  48.     public Delivery_Day Delivery_Day { get; set; }
  49. }    
  50.  
  51. //My GetAll Method
  52. public List<Fleetdata> GetAll()
  53. {
  54.    return _dbContext.Fleetdatas
  55.    .Include(x => x.Rest_Days)
  56.    .Include(x => x.Rest_Days.Select(r => r.Rest_Day))
  57.    .Include(y => y.Deliverydays)
  58.    .Include(y => y.Deliverydays.Select(d => d.Delivery_Day))
  59.    .ToList();
  60. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top