internal Profile GetOrCreateProfile(Profile userInfo) { Profile profile = _repo.GetById(userInfo.Id); if (profile == null) { return(_repo.Create(userInfo)); } return(profile); }
internal Profile GetProfileById(string id) { Profile profile = _repo.GetById(id); if (profile == null) { throw new Exception("invalid id"); } return(profile); }
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); }
internal Account GetById(string id) { Account profile = _repo.GetById(id); if (profile == null) { throw new Exception("Invalid Profile Id"); } return(profile); }
public Profile GetPublicProfile(string id) { return(_repo.GetById(id)); }