public UrlModelDto GetUrlAddress(string code) { try { UrlModel model = DataAccess.GetUrlByCode(code); if (model == null) { throw new Exception("داده یافت نشد"); } model.ViewCount++; if (DataAccess.Update(model)) { return(model.ConvertToDto()); } throw new Exception("خطا در بروزرسانی بازدیدها"); } catch (Exception ex) { AddException(ex); return(null); } }