So I have a duration in seconds of a video and I would like to display that duration in Razor.
Currently I am using
@TimeSpan.FromSeconds(item.Dura
You can extend your model class using a partial class definition.
public partial class My_class_that_has_been_created_by_EF { public string Timespan { get { return Timespan.FromSeconds(Duration).ToString(); } } }
Then use it in your view with
@Html.DisplayFor(modelItem => item.Timespan)