public ActionResult CreateHashtag(Hashtag newHashtag)
        {
            var ops = OperationsFactory.CreateHashtagOps();
            ops.CreateHashtag(newHashtag);

            return RedirectToAction("Index", "DraftPost");
        }
Example #2
0
 public void CreateHashtag(Hashtag newHashtag)
 {
     using (SqlConnection cn = new SqlConnection(Settings.ConnectionString))
     {
         cn.Query<Hashtag>("insert into Hashtag(HashtagType) Values (@hashType)",
             new { hashType = newHashtag.HashtagType});
     }
 }
Example #3
0
 public void CreateNewHashtagDbTest()
 {
     var repo = OperationsFactory.CreateHashtagOps();
     var hashtag = new Hashtag()
     {
         HashtagType = "Trends",
     };
     repo.CreateHashtag(hashtag);
     var list = repo.ListAllHashtags();
     Assert.AreEqual(1,list.Count);
 }
Example #4
0
 public void CreateHashtag(Hashtag newHashtag)
 {
     if (!string.IsNullOrEmpty(newHashtag.HashtagType))
         _repo.CreateHashtag(newHashtag);
 }