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 }); }
C Program to implement doubly linked list:
#include<stdio.h>
#include<alloc.h>
#include<stdlib.h>
#include<conio.h>
struct dlnode
{
Int info;
struct dlnode *link;
struct dlnode *prev;
}; typedef struct dlnode dln;
main( )
{
dln *root, *temp, *new, *ptr; char choice=’y’;
root=NULL;
while(choice= =’y’)
{
new=(dln*)malloc(sizeof(dln);
if(new= =NULL)
{
printf(“Memory allocation error…”); exit(0);
}
new->link=NULL; new->prev=NULL;
printf(“\nEnter node information :”);
scanf(“%d”,&new->info);
if(root= =NULL)
{
root=new; temp=root;
}
else
{
new->prev=temp; temp->link=new;
temp=new;
}
printf(“Do you want to continue…(y/n)”);
choice=getche();
}
printf(“\nDoubly linked list is:\n\n”);
/* Doubly linked list normal singly linked list if it is traversed using link field of the node*/
ptr=root;
while(ptr=NULL)
{
printf(“%d”,ptr->info);
ptr=ptr->link;
}
printf(“\n\nDoubly linked list(reverse order):\n\n”);
/*The pointer temp is pointing to the last node. So, we can use it traverse in reverse order*/
while(temp!=NULL)
{
printf(“%d”,temp->info);
temp=temp->prev;
}
getch();
}
#include<stdio.h>
#include<alloc.h>
#include<stdlib.h>
#include<conio.h>
struct dlnode
{
Int info;
struct dlnode *link;
struct dlnode *prev;
}; typedef struct dlnode dln;
main( )
{
dln *root, *temp, *new, *ptr; char choice=’y’;
root=NULL;
while(choice= =’y’)
{
new=(dln*)malloc(sizeof(dln);
if(new= =NULL)
{
printf(“Memory allocation error…”); exit(0);
}
new->link=NULL; new->prev=NULL;
printf(“\nEnter node information :”);
scanf(“%d”,&new->info);
if(root= =NULL)
{
root=new; temp=root;
}
else
{
new->prev=temp; temp->link=new;
temp=new;
}
printf(“Do you want to continue…(y/n)”);
choice=getche();
}
printf(“\nDoubly linked list is:\n\n”);
/* Doubly linked list normal singly linked list if it is traversed using link field of the node*/
ptr=root;
while(ptr=NULL)
{
printf(“%d”,ptr->info);
ptr=ptr->link;
}
printf(“\n\nDoubly linked list(reverse order):\n\n”);
/*The pointer temp is pointing to the last node. So, we can use it traverse in reverse order*/
while(temp!=NULL)
{
printf(“%d”,temp->info);
temp=temp->prev;
}
getch();
}
Comments
Post a Comment