I have a question. Why did you use an Interface(IEmployeeRepository) in HeadCountViewComponent instead of a class implemented that interface(MockEmployeeRepository)?
Because we don't want to know about the implementation details. You can change your interface implementation later but the view component doesn't need to know about that.
It’s dependency injection in our middleware we’ve already specified how the application handles IEmployeeRepository and that’s by services.AddTransient()
We greatly appreciate your effort, I have implemented ViewComponent and the problem is how to handle postbacks like grid event (sort, pagination). Can you please suggest me best approach?
intellisense is not showing g.key.Value,kinldy help me in this public IEnumerable EmployeeCountByDept(Dept? dept) { IEnumerable query = _employeeList; if (dept.HasValue) { query.Where(x => x.Department == dept.Value).ToList(); } return query.GroupBy(e => e.Department) .Select(g => new DeptHeadCount() { Department = g.Key., Count = g.Count() }).ToList(); }
No one goes with this much detail.Highly appreciate your effort.
You should teach Microsoft how to make tutorials. Thanks.
Your videos are just awesome. Keep doing this great work.
I could cancel my Pluralsight subscription because you're stuff is so much better. Thank you.
Man, your tutorials rock
Thanks so much...
Greetings from Brazil.
Thanks!
thank you. it helped me to implement
Super, Super helpful! Thank you!
If possible, Please make a playlist for .net 6, mvc core tutorials
merci your best
Thank you sir.
excellent
thank you!
what if I want to count different objects? do I have to create view component for each?
Sir Please make detailed videos on azure cloud computing.
I have a question. Why did you use an Interface(IEmployeeRepository) in HeadCountViewComponent instead of a class implemented that interface(MockEmployeeRepository)?
Because we don't want to know about the implementation details. You can change your interface implementation later but the view component doesn't need to know about that.
It’s dependency injection in our middleware we’ve already specified how the application handles IEmployeeRepository and that’s by
services.AddTransient()
naisss!
awesome. and are you in london these days??
How can we post data from view components?
We greatly appreciate your effort, I have implemented ViewComponent and the problem is how to handle postbacks like grid event (sort, pagination). Can you please suggest me best approach?
Thanks great but the interface needs to be registered to get it to work.
intellisense is not showing g.key.Value,kinldy help me in this
public IEnumerable EmployeeCountByDept(Dept? dept)
{
IEnumerable query = _employeeList;
if (dept.HasValue)
{
query.Where(x => x.Department == dept.Value).ToList();
}
return query.GroupBy(e => e.Department)
.Select(g => new DeptHeadCount()
{
Department = g.Key.,
Count = g.Count()
}).ToList();
}
You are in Landon. Wow
in a real world it isn't functional