public Guid Create(Guid hashTagId, Nullable <System.Guid> userId, string comment) { bn_HashTag bnHashTag = new bn_HashTag(); var hashtag = bnHashTag.GetById(hashTagId); var productTagId = Guid.NewGuid(); if (hashtag.Type == EHashtag_Type.System) { if (userId.HasValue && !IsExistsInUser((Guid)userId, hashTagId)) { var re = (int)db.pb_ProductTag_Create( productTagId, productId, hashTagId, userId, comment).Single(); if (re >= 0) { return(productTagId); } } } else { if (!IsExists(hashTagId)) { var re = (int)db.pb_ProductTag_Create( productTagId, productId, hashTagId, userId, comment).Single(); if (re >= 0) { return(productTagId); } } } return(Guid.Empty); }