public override void SendBandNotifications(NotificationType type, Guid bandId, BandMessageData data) { using (var ctx = new OpenGroovesEntities()) { string typeStr = type.ToString(); // Get list of users who are following this band and have notifications on to receive ctx.ContextOptions.LazyLoadingEnabled = true; var emails = (from r in ctx.UsersBands join s in ctx.UserSettings on r.UserId equals s.UserId where r.BandId == bandId && s.Value == "True" && s.Key.Equals(typeStr, StringComparison.OrdinalIgnoreCase) select s.User.Email).Distinct().AsEnumerable(); var replacements = BuildReplacements(data); var msg = TemplateBuilder.LoadTemplate(type, replacements); SendMessage(msg, emails); } }
public abstract void SendBandNotifications(NotificationType type, Guid bandId, BandMessageData data);