0

Recently we are converting Datatable to List of Models.. I had a class called Person ( personid ,PersonChildId} and I implemented my class as

public class Person 
{
    public Int64 PerosnId{ get; set; }
    public Int64 PersonChildID{ get; set; }
}

I sucessfully converted my Datatable to List<Person> by using simple for loop. But now the problem is as we know Datacolumn has a property called Caption. but unfortunately models don't have.
So how do we need implement a Caption property for the Model for these kind of scenarios.

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by AleMonteiro
0

You can create base class, like Model, that has the Caption property, and the Person class would extend the Model class, this way it would inherit the property. And every other class that extends Model would also have the Caption property.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.