예제 #1
0
        internal Profile GetOrCreateProfile(Profile userInfo)
        {
            Profile profile = _repo.GetById(userInfo.Id);

            if (profile == null)
            {
                return(_repo.Create(userInfo));
            }
            return(profile);
        }
예제 #2
0
        internal Profile GetProfileById(string id)
        {
            Profile profile = _repo.GetById(id);

            if (profile == null)
            {
                throw new Exception("invalid id");
            }
            return(profile);
        }
예제 #3
0
        internal Following Create(Following newFollowing, Profile userinfo)
        {
            Profile follower  = _prepo.GetById(newFollowing.FollowerId);
            Profile following = _prepo.GetById(newFollowing.FollowingId);

            if (follower == null)
            {
                throw new Exception("Invalid follower Id");
            }
            if (following == null)
            {
                throw new Exception("invalid following Id");
            }
            newFollowing.CreatorId = userinfo.Id;
            _repo.Create(newFollowing);
            return(newFollowing);
        }
예제 #4
0
        internal Account GetById(string id)
        {
            Account profile = _repo.GetById(id);

            if (profile == null)
            {
                throw new Exception("Invalid Profile Id");
            }
            return(profile);
        }
예제 #5
0
 public Profile GetPublicProfile(string id)
 {
     return(_repo.GetById(id));
 }