title: If no data in database then how to show "nodata" message in asp.net core
body: <p>How to show <strong>No have any Data</strong> message in List view page if no have any record in the database.</p>
  <p>This is my ICouponRepository interface to inject in this controller.</p>
  <pre><code>IEnumerable&lt;ManuItem&gt; GetAllManuItem();
  </code></pre>
  <p>This is my SQLManuItemRepository to inherit ICouponRepository</p>
  <pre><code>public IEnumerable&lt;ManuItem&gt; GetAllManuItem()
      {
          try
          {
              return context.ManuItems.Include(mi =&gt; mi.Category)
                                      .Include(mi =&gt; mi.SubCategory)
                                      .Where(mi =&gt; mi.IsDelete == false);
          }
          catch (Exception ex)
          {
              var exception = ex.Message;
              return null;
          }
      }
  </code></pre>
  <p>This is my Controller method</p>
  <pre><code>public IActionResult Index()
      {
          try
          {
              var model = manuItemRepository.GetAllManuItem();
              if (model == null)
              {
                  ViewBag.NoData = &quot;No have any Data&quot;;
                  return View();
              }
              return View(model);
          }
          catch (Exception ex)
          {
              ViewBag.Error = &quot;Somthing was Worng&quot; + ex.Message;
          }
          return View();
      } 
  </code></pre>
  <p><strong>Any change in this method or change in View?</strong></p>