This question is locked. New answers and comments are not allowed.
hi,
this is a subset of my model to illustrate the thing
[URL=http://www.hostingpics.net/viewer.php?id=984351model.jpg][IMG]http://img15.hostingpics.net/pics/984351model.jpg[/IMG][/URL]
it's for a fitness center management software so :
ADHERANTS -> customers
ABONEMENTS -> subscriptions
SEANCES -> fitness session
now i want to show a list of customers with their sessions count :
this query gave me an exception
var adheants = _context.ADHERANTs.Select(c => new
{
adh = c,
cnt = c.ABONNEMENTs.OrderByDescending(s=>s.AB_DATE_DEBUT).FirstOrDefault().SEANCEs.Count
});
my guess is beacause some of the cusomers don't have subscriptions yet .
secondly : What the Defaultifempty operator and can it help me in this situation
thanks for your help and good day
this is a subset of my model to illustrate the thing
[URL=http://www.hostingpics.net/viewer.php?id=984351model.jpg][IMG]http://img15.hostingpics.net/pics/984351model.jpg[/IMG][/URL]
it's for a fitness center management software so :
ADHERANTS -> customers
ABONEMENTS -> subscriptions
SEANCES -> fitness session
now i want to show a list of customers with their sessions count :
this query gave me an exception
var adheants = _context.ADHERANTs.Select(c => new
{
adh = c,
cnt = c.ABONNEMENTs.OrderByDescending(s=>s.AB_DATE_DEBUT).FirstOrDefault().SEANCEs.Count
});
my guess is beacause some of the cusomers don't have subscriptions yet .
secondly : What the Defaultifempty operator and can it help me in this situation
thanks for your help and good day