I created a DateTime Field
in order to select the soccer match day and I used this field in order to create part of my slug string.
I have:
public class Match
{
[Required, Display(Name = "Date du match")]
[DataType(DataType.Date)]
public DateTime? MatchDay { get; set; }
[Required, Display(Name = "Mot-clé")]
public string Slug
{
get { return "_" + MatchDay; }
}
}
On my Index.cshtml page, my MatchDay
field is well displayed for exemple with 25/07/2019
, but my slug value displayed is not good because I get _25/07/2019 00:00:00
.
I would like to get _25/07/2019
Do you have any idea to do that ?
I'm pretty new with C#
/ASP.NET
and I don't find anything about this issue.
Thank you