summaryrefslogtreecommitdiff
path: root/Project-Unite/ACL.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Project-Unite/ACL.cs')
-rw-r--r--Project-Unite/ACL.cs7
1 files changed, 7 insertions, 0 deletions
diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs
index dc12487..73636c7 100644
--- a/Project-Unite/ACL.cs
+++ b/Project-Unite/ACL.cs
@@ -28,6 +28,13 @@ namespace Project_Unite
return hpr.Raw(CommonMark.CommonMarkConverter.Convert(hpr.Encode(md)));
}
+ public static bool IsFollowed(string you, string fId)
+ {
+ var db = new ApplicationDbContext();
+ var uid = db.Users.FirstOrDefault(x => x.UserName == you).Id;
+ return db.Follows.FirstOrDefault(x => x.Follower == uid && x.Followed == fId) != null;
+ }
+
public static IHtmlString UserLink(this HtmlHelper hpr, string userId)
{
using(var db = new ApplicationDbContext())