Exemplo n.º 1
0
        public HttpContextDataModelCache(HttpContext context)
        {
            _cache   = context.RequestServices.GetService(typeof(IMemoryCache)) as IMemoryCache;
            _session = context.Session;
            _logger  = ApplicationLogging.CreateLogger <HttpContextDataModelCache>();

            _logger.LogTrace("Session Id:{0}", _session.Id);
        }
 public static ClosedXML.Excel.XLWorkbook ConvertToExcel(this DataSet ds)
 {
     ClosedXML.Excel.XLWorkbook xls = new ClosedXML.Excel.XLWorkbook();
     try
     {
         for (int i = 0; i < ds.Tables.Count; i++)
         {
             ds.Tables[i].TableName = $"_{ds.Tables[i].TableName}";
         }
         xls.Worksheets.Add(ds);
     }
     catch (Exception ex)
     {
         ApplicationLogging.CreateLogger("QueryExtensionMethods").LogError(ex, ex.Message);
     }
     return(xls);
 }