ToBeProcessed.constructor - place CSV values into fields on an object
$30-100 USD
Abgeschlossen
Veröffentlicht vor mehr als 12 Jahren
$30-100 USD
Bezahlt bei Lieferung
A **partial** class that represents an incoming entity that needs to be processed. It takes an input string (CSV format), extracts the values and places the values onto fields of the same name. The name of the field is determined by the ordinal position of the data in the CSV string and finding the matching entry in the property ArrayList *header*.
The *header* ArrayList will contain objects of type FieldDef. The FieldDef has public fields called fieldname and type. The type is used so the incoming data can be converted into the correct type for the field on the object.
## Deliverables
### Project: [login to view URL]
Namespace: AgentMangler
# Overview
A **partial** class that represents an incoming entity that needs to be processed. It takes an input string (CSV format), extracts the values and places the values onto fields of the same name. The name of the field is determined by the ordinal position of the data in the CSV string and finding the matching entry in the property ArrayList *header*.
The *header* ArrayList will contain objects of type FieldDef. The FieldDef has public fields called fieldname and type. The type is used so the incoming data can be converted into the correct type for the field on the object.
# Details
There will be a static header ArrayList that represents the name and type of every field in an object of type FieldDef.
The class will have a constructor method.
Public ToBeProcessed (string CSV)
The CSV data will be parsed by splitting it by commas, then getting each entry and getting the matching entry, by its index, in the header arraylist. The data will then be converted according to the type stored in the header FieldDef object. That data will then be assigned to a property of the same field name on the current object (by reflection).
LINQ?
<[login to view URL]>
# Scope
The partial class [login to view URL]
Unit tests ([login to view URL]) that demonstrate:
The loading of CSV data into an ToBeProcessed object
Mocked objects are to be in a separate file
FieldDef is mocked