I am using Entity Framework for my latest project and my goal is to retrieve the count of the amount of likes a product in the system has.
I have 2 models:
Product and ProductLike
I would like to be able to add an int property to the Product model called NumberOfLikes. However, if I do this EF Migrations will create it as a column in the database. Is there a way to declare a property in a model and then simply get all products and join to get the product like count and set the property?
I am aware this is somewhat what ViewModels are for, but I would like to make the NumberOfLikes property part of the product well before the UI layer, just not part of the database.