예제 #1
0
        public static User FindByUserName(this DBEntities DB, string userName)
        {
            User user = DB.Users.Where(u => u.UserName == userName).FirstOrDefault();

            return(user);
        }
예제 #2
0
        public static bool AlreadyLike(this DBEntities DB, int postId, int userId)
        {
            Like like = DB.Likes.Where(l => (l.UserId == userId) && (l.PostId == postId)).FirstOrDefault();

            return(like != null);
        }
예제 #3
0
        public static bool UserNameExist(this DBEntities DB, string userName)
        {
            User user = DB.Users.Where(u => u.UserName == userName).FirstOrDefault();

            return(user != null);
        }