예제 #1
0
파일: DALTag.cs 프로젝트: Weej1/geekinside
 public int AddTag(string tagName)
 {
     using (geekinsidekmsEntities context = new geekinsidekmsEntities())
     {
         Tag dbTag = new Tag
         {
             TagName = tagName
         };
         try
         {
             context.AddToTags(dbTag);
             context.SaveChanges(System.Data.Objects.SaveOptions.DetectChangesBeforeSave);
         }catch(Exception e){
             System.Diagnostics.Debug.WriteLine(e.InnerException.Message);
         }
         return dbTag.Id;
     }
 }
예제 #2
0
파일: ActiveRecord.cs 프로젝트: PoulXia/QT
 public static void Setup(int testItems)
 {
     SetTestRepo();
     for(int i=0;i<testItems;i++){
         Tag item=new Tag();
         _testRepo._items.Add(item);
     }
 }
예제 #3
0
파일: ActiveRecord.cs 프로젝트: PoulXia/QT
 public static void Setup(Tag item)
 {
     SetTestRepo();
     _testRepo._items.Add(item);
 }
예제 #4
0
 /// <summary>
 /// Create a new Tag object.
 /// </summary>
 /// <param name="tagID">Initial value of the TagID property.</param>
 /// <param name="createDate">Initial value of the CreateDate property.</param>
 /// <param name="portalID">Initial value of the PortalID property.</param>
 /// <param name="contentID">Initial value of the ContentID property.</param>
 /// <param name="tag1">Initial value of the Tag1 property.</param>
 public static Tag CreateTag(global::System.Int32 tagID, global::System.DateTime createDate, global::System.Int32 portalID, global::System.Int32 contentID, global::System.String tag1)
 {
     Tag tag = new Tag();
     tag.TagID = tagID;
     tag.CreateDate = createDate;
     tag.PortalID = portalID;
     tag.ContentID = contentID;
     tag.Tag1 = tag1;
     return tag;
 }
예제 #5
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Tags EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTags(Tag tag)
 {
     base.AddObject("Tags", tag);
 }
예제 #6
0
 /// <summary>
 /// 创建新的 Tag 对象。
 /// </summary>
 /// <param name="id">Id 属性的初始值。</param>
 /// <param name="tagName">TagName 属性的初始值。</param>
 public static Tag CreateTag(global::System.Int32 id, global::System.String tagName)
 {
     Tag tag = new Tag();
     tag.Id = id;
     tag.TagName = tagName;
     return tag;
 }