Watch solution on YouTube
Error CS0116 A namespace cannot directly contain members such as fields or methods
To fix it replace
namespace MVC2Models1View.Controllers
{
CompanyEntities db = new CompanyEntities();
public class HomeController : Controller
{
With
namespace MVC2Models1View.Controllers
{
public class HomeController : Controller
{
CompanyEntities db = new CompanyEntities();
No comments:
Post a Comment