Exemplo n.º 1
0
        public AddResult Add(string userName, string message)
        {
            var log = new UserLog { Date = DateTime.Now, Message = message, UserName = userName };

            try
            {
                this.dataContext.UserLogs.Add(log);

                this.dataContext.SaveChanges();
            }
            catch (Exception)
            {
                return AddResult.Failure;
            }

            return AddResult.Success;
        }
Exemplo n.º 2
0
 public static UserLogDto Build(UserLog log)
 {
     return new UserLogDto { Date = log.Date.ToShortDateString(), Message = log.Message };
 }