コード例 #1
0
ファイル: LogController.cs プロジェクト: rikp777/Fit
 public IActionResult AddWeightlog(LogAddWeightLogViewModel data)
 {
     if (_weightLogLogic.Add(AuthController.GetAuthUserId(User), WeightLogViewModelToInterface(data)))
     {
         return(RedirectToAction("Index"));
     }
     return(RedirectToAction("Index"));
 }
コード例 #2
0
ファイル: LogController.cs プロジェクト: rikp777/Fit
        private IWeightlog WeightLogViewModelToInterface(LogAddWeightLogViewModel viewmodel)
        {
            var weightLog = new WeightLog
            {
                DateTime = DateTime.Now,
                User     = AuthController.GetAuthUser(User),
                Weight   = viewmodel.Weight
            };

            return(weightLog);
        }