0
   using System;
   using System.Collections.Generic;
   using System.Linq;
    using System.Web;
   using System.Web.Mvc;

   namespace TestBackend.Controllers
   {
     public class HomeController : Controller
       {
    public ActionResult LogIn()
    {
        return View();
    }
    [HttpPost]
    [ValidateAntiForgeryToken]
    public ActionResult Login(User u) 
    {
        if (ModelState.IsValid)
        {
            using(MyDatabaseEntities dc = new MyDatabaseEntities())
            {
                var v= dc.Users.Where(a=>a.UserName.Equal(u.UserName)&&         (a=>a.Password.Equal(u.Password)).firstordefault());
                if (v!=null)
                {
                    Session["LogedUserName"]=v.UserName.ToString();
                    return RedirectToAction("AfterLogIn");
                 }

              }
           }
         return View(u);
         }
        public ActionResult AfterLogIn()
      {

          return View();
          }
       }
    }

Inconsistent accessibility: parameter type 'TestBackend.Controllers.User' is less accessible than method 'TestBackend.Controllers.HomeController.Login(TestBackend.Controllers.User)'

I am new in C# mvc user i can't understand why parameter type is less accesible

Saba Ch
  • 1
  • 2
  • Yes, that's correct. There's no question mark anywhere in your question. What do you want to know? – Thomas Weller Sep 06 '16 at 18:57
  • 2
    If you have a public function or constructor in a public class all of it's parameters must also be public. Make the `TestBackend.Controllers.User` class public. – Scott Chamberlain Sep 06 '16 at 18:57

0 Answers0