コード例 #1
0
 public DiariesBo Create(Diary diary)
 {
     if (diary == null) throw new ArgumentNullException("diary");
     if (diary.CurrentDate != null)
         return new DiariesBo()
         {
             Url = _urlHelper.Link("Diaries", new { dairyid = diary.CurrentDate.Value.ToString("yyyy-MM-dd") }),
             CurrentDay = (DateTime)diary.CurrentDate,
             Username = diary.UserName
         };
     return null;
 }
コード例 #2
0
 public Diary Parse(DiariesBo diariesBo)
 {
     try
     {
         var diaries = new Diary();
         if (diariesBo.CurrentDay!=default(DateTime))
         {
             diaries.CurrentDate = diariesBo.CurrentDay;
             diaries.UserName = diariesBo.Username;
         }
         return diaries;
     }
     catch (Exception)
     {
         return null;
     }
 }