Is this example bad practice because it make several database calls?
Is it any way I can make this to one DB call? Like use 'where' instead of 'firstOrDefault' and compare FlagDate with each date on the message in my messageList?
foreach (var message in messageList)
{
var dayFlag = db.DayFlags.FirstOrDefault(x =>
x.FlagDate == message.MessageDate);
}