예제 #1
0
        public UserInterest AddUser(string name)
        {
            UserInterestRepository uiRep    = new UserInterestRepository();
            UserInterest           interest = new UserInterest
            {
                Id = name
            };

            uiRep.Add(interest);

            return(interest);
        }
예제 #2
0
        public UserInterest GetOrAddUser(string name)
        {
            UserInterestRepository uiRep    = new UserInterestRepository();
            UserInterest           interest = uiRep.Get(name);

            if (interest == null)
            {
                interest = new UserInterest
                {
                    Id = name
                };
                uiRep.Add(interest);
            }
            return(interest);
        }