I have the following model object in c# that I'm receiving in a WEB API from a POST - Does anyone know how I would write this object to a database? The tables can be whatever, I'm just not sure how to cycle through this model to get the 'Sequence', 'Quote' & 'Items' to flat files from objects.
[Serializable] public class PickupDetail { public string driver_name; public class PickupDate
{ public DateTime pickup_date; public class Sequence { public int sequence_id; public int location_id; public string company; public string address; public string city; public string state; public string zip;
public class Quote
{ public int quote_id;
public bool complete;
public string customer;
public string destination_customer;
public string purchase_order;
public class Item
{ public int quote_pickup_id;
public int return_id;
// Quote Detail
public int quote_detail_id;
public string description;
public bool selected;
public bool show_note;
public int pickup_qty;
public int qty_received;
public int labels_printed;
public string comments;
public int return_qty;
public int qty_returned;
public string return_comments;
public DateTime date_time;
public string driver_name;
public class OriginalItem
{
public int qty_received;
public int labels_printed;
public string comments;
public int qty_returned;
public string return_comments;
}
public OriginalItem original;
}
public List<Item> items;
}
public List<Quote> quotes;
}
public List<Sequence> sequence;
}
public List<PickupDate> dates;
}
Aucun commentaire:
Enregistrer un commentaire