public virtual MainViewModel <M> SearchList(T SearchContext) { var message = new ExceptionMessage("Enter->" + MethodBase.GetCurrentMethod()); List <M> results = null; var searchContextList = new List <SearchContextEntity>(); if (NotValidIdentity()) { SessionExpired(message); } else { try { results = GridSearch(SearchContext, message); if (results.Count > _config.RowsLimit) { message.Fail(); message.LastUserMessage = Messages.GeneriLargeDataErrorMsg; return(new MainViewModel <M>(new List <M>(), message)); } } catch (Exception ex) { LogBaseControllerMessage(ex, message); } } return(new MainViewModel <M>(results, message)); }
public void LogBaseControllerMessage(Exception ex, ExceptionMessage message) { message.Fail(); message.LastMessage = ex.Message; if (message.UserMessages.Count == 0) { message.LastUserMessage = GenericSessionErrorMsg; } if (Logger == null) { Logger = new ExceptionWriteLog(); } Logger.LogException(message, LogFormat, ex); }
protected void SessionExpired(ExceptionMessage message) { message.Fail(); }