I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Recursion:
main()
{
-----;
fun();
-----;<------------address of this instruction is stored in STACK
}
fun()
{
----:
}
The recursion can be used to solve certain problems where the problems have base condition. When the base condition is satisfied the call should terminate otherwise a call is made again with changed value. Means recursion is used only in those cases when the same set of statements are to be executed again and again with changed value and that changed value reaches to base condition the recursive call should terminate.
Recursion is another good example of programming field where STACK is used. Recursion is an art of programming or a technique in programming in which the subprogram calls itself. In programming usually when a subprogram is written it is called in main program. Using a statement in the main program can do a call to the subprogram. If a call statement of the subprogram is used within the definition of the same subprogram then it is termed as recursion.
Whenever a function (in case of C the subprogram is function) call is made in main program the control transfers to the function, the function is executed and control transfers back to the calling point. Note here that the internal STACK is used to store the address of the next instruction that is to be execution completes.main()
{
-----;
fun();
-----;<------------address of this instruction is stored in STACK
}
fun()
{
----:
}
The recursion can be used to solve certain problems where the problems have base condition. When the base condition is satisfied the call should terminate otherwise a call is made again with changed value. Means recursion is used only in those cases when the same set of statements are to be executed again and again with changed value and that changed value reaches to base condition the recursive call should terminate.
Comments
Post a Comment