Q: Notmapped property is not supported in LINQ to Entities I have a ProUser class which has ProUserContacts is a notmapped property, I'm using this property to represent the number of contacts were created by specific proUser :
        public class ProUser : BaseEntity
        {
            public Guid? UserId { get; set; }
            ...
            [NotMapped]
            public int ProUserContacts { get; set; }
        }

And a controller to query then sort proUser list by ProUserContacts :
    public IEnumerable<WebDataLayer.Models.ProUser> ListAllPaging(string sortBy)
            {
                var proUsers = _proUserService.Filter(p => !p.IsDelete);
                proUsers = proUsers.OrderBy(x => x.JoinedDay);

                foreach (var item in proUsers)
                {
                    item.ProUserContacts = CountProUserContact(item.Id);
                }

                switch (sortBy?.ToLower())
                {
                   case "prousercontact":
                        proUsers = proUsers.OrderBy(x => x.ProUserContacts);
                        break;

                  default:
                        proUsers = proUsers.OrderBy(x => x.Id);
                        break;
                }
             return proUsers;
            }

I want to show the proUser List sorted by ProUserContacts but it comes to an error: The specified type member 'ProUserContacts' is not supported in LINQ to Entities. Only initializers, entity members, and entity navigation properties are supported. at this line:
proUsers = proUsers.OrderBy(x => x.ProUserContacts);

I have tried a couple solutions recommended by the same topics but it didn't work then. 
Need your suggestions!!! 
UPDATE: code for _proUserService:this is simply a set of connection to DB using Entity framework
internal class ProUserService : EntityService<ProUser>, IProUserService
    {        
        public ProUserService(IUnitOfWork unitOfWork, IGenericRepository<ProUser> repository) : base(unitOfWork, repository)
        {     
        }

        public List<ProUser> GetProUsersByCustomerCode(string customerCode)
        {
            var proUsers = Repository.Filter(x => !x.IsDelete && x.CustomerCode.ToLower().Equals(customerCode.ToLower())).ToList();
            return proUsers;
        }
    }


A: The problem seem coming from [NotMapped] attribute set at this property:
[NotMapped]
public int ProUserContacts { get; set; }

As a consensus, you cannot use any properties that are not mapped as column name in database inside LINQ to Entities query directly because EF doesn't know how to convert ProUserContacts into proper ORDER BY SQL statement. You need to either materialize the query first with AsEnumerable()/ToList() before OrderBy():
var prusers = proUsers.ToList().OrderBy(x => x.ProUserContacts);

or using encapsulation by create an IQueryable extension method to be used as substitute of direct OrderBy:
public class ProUserVM
{
    public int ProUserContacts { get; set; }
}

public static IQueryable<ProUserVM> OrderByContacts(this IQueryable<ProUser> prousers)
{
    return proUsers.Select(x => new ProUserVM
    {
        // other properties
        ProUserContacts = CountProUserContact(item.Id)
    }).OrderBy(x => x.ProUserContacts);
}

// usage
proUsers = proUsers.OrderByContacts();

or remove [NotMapped] attribute and make the column name based from the property name.
Reference:
Computed Properties and Entity Framework

A: It means that the LINQ query can not be evaluated and translates to the equivalent database query, so first, you must load data to the client-side evaluation by calling AsEnumerable() or ToList() then do whatever you want to do with NotMapped property:
proUsers = proUsers.OrderBy(x => x.JoinedDay);
proUsers = proUsers.ToList().OrderBy(x => x.ProUserContacts);

read more about client vs server  evaluation:https://learn.microsoft.com/en-us/ef/core/querying/client-eval
