Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

how can I assign the datetime value into string variable in model class

$
0
0

I have  the following model .  How can I store the datetime value which are stored in the column MOTDate , TaxDate  into the column MOTDateString, TaxDateString  automatically.

public class Vehicles
    {
        public DateTime? MOTDate { get; set; }
        public DateTime? TaxDate { get; set; }
        public DateTime? RegDate { get; set; }       
        public DateTime? InsuredDate { get; set; }
        [NotMapped]
        public string MOTDateString {get;set;}
        [NotMapped]
        public string TaxDateString { get; set; }

        }        
       

 


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>