How to Calculate Values Between Ages in mvc5 code first

Dec 3 2018 6:58 AM
Hello guys, I want to Collect values between ages like this table and i am using mvc5 code first how can i display count values between the ages from my model
 
 age from
1 to 10 
 age from
10 to 20
age from
20 to 30 
age from
30 to 40 
 ?  ?  ?  ?
 
The ages i entered by a textbox how can i Sort and collect them

and this is my model

public class Pation
{
[Key]
public int Id { get; set; }
public string PationName { get; set; }
public int Age { get; set; }
public Sex Sex { get; set; }
public Viset viset { get; set; }
public Free IsFree { get; set; }
public string NameProd { get; set; }
public string esalNum { get; set; }
public string Pationphone { get; set; }
public string cons { get; set; }
public DateTime DateWared { get; set; } = DateTime.UtcNow.AddHours(3);


Answers (1)