i need to create a viewmodel to define properties for getting counts of data from different tables as i need to display all this in a single view
customer table -- count of all customers
count of all active customers
order table -- count of all pending orders
-- count of all completed orders
-- count of products sold productwise
i tired testviewmodel
public int customerId get; set; }
public int customerscount{ get; set; }
public bool IsActive { get; set; }
in controller
var result = db.Customers.Select(d => new testviewmodel{customerscount = d.customerId.Count()}).ToString();
in view
@Model.result