خرید بک لینک

Vote count: 0

In Epplus, I am used to defining column headers in my model with the DisplayName("") attribute as they appear in Excel when exporting a collection. For example, if the code block shown at the bottom is my View Model, I use [DisplayName("some string")] from the System.ComponentModel namespace to decorate the model properties as needed.

My question is this: can Epplus read any other attributes from the model? I'm thinking it would be helpful if I could decorate specific properties with a flag that I could use to tell Epplus to format specific columns in specific ways as noted in the model.

I'm hoping that if there are other attributes than DisplayName that I could take advantage of, it might simplify my code elsewhere.

public class EpplusViewModel
{
    public string Campus { get; set; }

    [DisplayName("Student Name")]
    public string StudentName { get; set; }

    [DisplayName("Student ID")]
    public int StudentID { get; set; }

    [DisplayName("Session Start Time")]
    public DateTime SessionStartTime { get; set; }
}

asked 33 secs ago

برچسب: نویسنده: استخدام کار تاريخ: يکشنبه 30 خرداد 1395 ساعت: 9:48

صفحه بندی