コード例 #1
0
        public void GetDateType_Test()
        {
            IDataRepository <Person>  uu = new PersonData();
            IDataRepository <Content> ui = new CommentData();
            var person  = uu.GetById(1);
            var comment = ui.GetById(1);

            Console.WriteLine($"{person.FirstName}\n{comment.Journey}");
        }
コード例 #2
0
        public void ContentString_Test()
        {
            IDataRepository <Person> userDB = new PersonData();
            var     person  = userDB.GetById(1);
            Journal journal = new Journal();

            journal.Journey = new ContentText("Hi all this is @sally", new List <Person> {
                person
            });
        }
コード例 #3
0
        public void GetByTAGZ_Test()
        {
            ITags <Journal>          tagDB = new JournalData();
            IDataRepository <Person> peron = new PersonData();
            var person = peron.GetById(3);
            var result = tagDB.GetByTag(person);

            foreach (var item in result)
            {
                Console.WriteLine(item.Title);
            }
        }
コード例 #4
0
        public void GetByTag_User_Test()
        {
            // Get tag by user
            IDataRepository <Person> getUser = new PersonData();
            var user = getUser.GetById(2);
            Tag tag  = new Tag()
            {
                UserTag = user
            };
            ITag <Journal> getbytag = new JournalData();
            var            journals = getbytag.GetByTag(tag);

            foreach (var journal in journals)
            {
                Console.WriteLine($"{journal.Title}");
            }
        }
コード例 #5
0
        public void Tag_test()
        {
            IDataRepository <Person> retrieveUser = new PersonData();
            Content tag  = new Content();
            var     user = retrieveUser.GetById(3);

            tag.Tagz = new List <object> {
                "hi", user, "all"
            };
            var    reTag  = tag.Tagz.Where(r => tag.Tagz.Contains("Sally"));
            Person person = new Person();

            foreach (var item in tag.Tagz)
            {
                if (item is Person)
                {
                    Console.WriteLine("HI");
                    person = (Person)item;
                }
                Console.WriteLine(item.GetType());
            }
            Console.WriteLine(person.FirstName);
        }