C# Design a class with interface?

Posted by Haroon on Stack Overflow See other posts from Stack Overflow or by Haroon
Published on 2011-11-17T01:47:35Z Indexed on 2011/11/17 1:50 UTC
Read the original article Hit count: 227

Filed under:
|

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"});

© Stack Overflow or respective owner

Related posts about oop

Related posts about c#-3.0