C# Design a class with interface?
- by Haroon
I am having a bit of trouble understanding how I will design a class.
My class will have 3 methods
ICollection<Field> GetFields();
//perform validation internally - return back the object
T UpdateFields(ICollection<Field> fields);
//pass in model object with values on it, set up fields, then pass back all fields
ICollection<Field> GetFieldsWithValues(T object);
What is the best way to construct/design such a class keeping in mind:
1. The model object I pass in will be one of 3 or 4 tables, however when I call GetFIelds - internally for each object I know what fields will be there i.e.
list.add(new Field{name = "id", value = "5"});
list.add(new Field{name = "nameofcompany", value = "super guys"});