Beispiel #1
0
        public ActionResult <WlogHistoryReadDto> GetWlogHistoryById(int id)
        {
            var history = _repository.Set().Where(x => x.Wlog.ID == id);

            if (history != null && history.Any(x => x.SysFields.IsDeleted != true))
            {
                return(Ok(_mapper.Map <WlogHistoryReadDto>(history)));
            }
            return(NotFound());
        }
Beispiel #2
0
        public ActionResult DeleteAccount(int id)
        {
            var account = _repository.Find(id);

            if (account == null)
            {
                return(NotFound());
            }
            account.SysFields.IsDeleted = true;
            var history = _wlogHistoryRepository.Set().Where(x => x.Wlog.ID == id);

            if (history.Count() > 0)
            {
                foreach (var item in history)
                {
                    item.SysFields.IsDeleted = true;
                }
            }
            _repository.Save();

            return(NoContent());
        }