/// <summary>
 /// Deprecated Method for adding a new object to the Tag EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToTag(Tag tag)
 {
     base.AddObject("Tag", tag);
 }
示例#2
0
        /// <summary>
        /// Convert the Tags from domain object to data object.  If the tag
        /// already exists in the database the tag will be attached to the
        /// existing record stopping duplicates being created.
        /// </summary>
        /// <param name="AuditDomainObject">Domain object with any tags associated.</param>
        /// <param name="AuditRecord">Audit data record where the tags need to
        /// be attached if they already exist and added if they do not.</param>
        /// <param name="Ctx">Context to manage the tags being attached or added.</param>
        /// <returns></returns>
        public static Audit ConvertTagAttributes(AuditObject AuditDomainObject, Audit AuditRecord, AuditEntities Ctx)
        {
            foreach (var tagObject in AuditDomainObject.Tags)
            {
                Tag tag = GetTag(tagObject, Ctx);

                if (tag != null)
                    AuditRecord.Tag.Add(tag);
                else
                {
                    var tagAttribute = new Tag
                                           {
                                               TagName = tagObject,
                                               DateCreated = DateTime.Now
                                           };
                    AuditRecord.Tag.Add(tagAttribute);
                }
            }
            return AuditRecord;
        }
 /// <summary>
 /// Create a new Tag object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="tagName">Initial value of the TagName property.</param>
 /// <param name="dateCreated">Initial value of the DateCreated property.</param>
 public static Tag CreateTag(global::System.Int32 id, global::System.String tagName, global::System.DateTime dateCreated)
 {
     Tag tag = new Tag();
     tag.Id = id;
     tag.TagName = tagName;
     tag.DateCreated = dateCreated;
     return tag;
 }