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 }); }
Procedure
|
Function
|
A procedure is a block of code that can't returning a value. You can
say it’s a types of function when that doesn’t return the value.
Example.
Module ABC
Sub Main()
SProcedure()
End Sub
Sub SProcedure()
Console.WriteLine("dotprogramming.blogspot.com")
End Sub
End Module
|
A function is a block of code and after running its code returns a
value to the calling code.
Example
Module ABC
Dim a As Integer = 10
Dim b As Integer = 20
Dim result As Integer
Sub Main()
result = Addition(a, b)
Console.WriteLine(Addition(a, b))
End Sub
Function Addition(ByVal c
As Integer, _
ByVal d
As Integer) As Integer
Return c+d
End Function
End Module
|
Procedure are not categorize or you can say it doesn’t divide in
parts.
|
Functions are divide in two parts
1. Built-in
function
2. User-defined
function
|
Use “Sub” keyword for creating procedure
|
Use “function” keyword for creating function.
|
Procedure will execute when action is called
|
But in case of function you can say it’s a loop.
|
Comments
Post a Comment