我想實現電子郵件功能,用戶可以發送電子郵件給20天后還沒有登錄的配置文件,也希望每10天后重複一次。有三張表的Linq Query在x天后加入發送提醒
I have three tables
1) "details" table where profile is maintained.
2) "notify" table where i keep a track of notification send to profiles.
3) "profile" table where i keep track of the login information of profile.
到目前爲止,我已經試過這 -
list = (from c in ctx.details.AsEnumerable()
join u in ctx.profile.AsEnumerable()
join a in ctx.notify..AsEnumerable()
on c.profileid equals u.profileid equals a.profileid
where (u.last_login_date == null &&
(DateTime.Now - u.last_login_date).TotalDays >= 20)
select new details
{
profileid = c.profileid.ToString(),
firstname = c.firstname,
lastname = c.lastname,
email = c.email
}).ToList();
My tables are -> details notify profile ----------- ------------ -------------- profileid profileid profileid firstname alert_date(datetime) last_login_date(datetime) lastname email
其中alert_date是,如果他之前已經發送電子郵件和last_login_date是 日期時的日期他最後登錄了個人資料。
但我相信這是行不通的。我希望細節表能夠充滿細節。 幫幫我。
您沒有解決方案@ stian.net? –