I'm working on a Asp.Net MVC 5
project that uses code first
and all entities have a property named UserId
of type string
. When I make queries filtering by a certain user ( Asp.Net Identity
) I do so:
string currentUserId = User.Identity.GetUserId();
var products = await db.Products.Where(_ => _.UserId == currentUserId).ToListAsync();
Am I losing performance for not having a foreign key relationship and just saving UserId
on a string
property?