TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Niraj Singh
NA
159
16.4k
can i declare variable in controller scope in MVC 5
Nov 23 2019 11:34 AM
Hello All,
Can i declare a variable in controller scope in Asp.net Mvc5 application or not?
For Example:
public class EmloyeeController : Controller
{
private readonly IEmployee _employee;
public EmployeeController(IEmployee emp){
{
_employee=emp;
}
}
this line gives error that "Method must have return type" where I have declare a private variable of type IEmployee.
Reply
Answers (
2
)
How to set custom notification sound in asp.net MVC?
How to fix this error on chtml file to access your cs file?