public static Tag SetEntity(TagData tagData)
 {
     return new Tag
                {
                   Id = tagData.Id,
                   Name = tagData.Name,
                   WhatId = tagData.WhatId
                };
 }
        public void can_create_tag_on_user()
        {
            var repo = new TagDataRepository();

            var userRepo = new UserDataRepository();
            var selectUser = userRepo.SelectById(1);

            Assert.IsNotNull(selectUser);

            TagData tag = new TagData {Name = "philles", WhatId = selectUser.Id};
            repo.Add(tag);

             using (ISession session = NBHelper.OpenSession())
            {
                var result = session.Get<TagData>(tag.Id);
                Assert.IsNotNull(result);
                Assert.AreNotSame(tag, result);
                Assert.AreEqual(tag.WhatId, result.WhatId);
                Assert.IsNotNull(result.Id);
            }
        }