예제 #1
0
        public KSociety.Com.App.Dto.Res.Copy.Common.Tag Execute(Tag request)
        {
            var commonTag = _mapper.Map <Domain.Entity.Common.Tag>(request);

            _tagRepository.Add(commonTag);
            return(_unitOfWork.Commit() == -1 ? new KSociety.Com.App.Dto.Res.Copy.Common.Tag(Guid.Empty) : new KSociety.Com.App.Dto.Res.Copy.Common.Tag(commonTag.Id));
        }
예제 #2
0
        public async Task <ActionResult <Tag> > PostTag(Tag tag)
        {
            _ITag.Add(tag);
            await _ITag.SaveAsync();

            return(CreatedAtAction("GetTag", new { id = tag.TagId }, tag));
        }
예제 #3
0
        public KSociety.Com.App.Dto.Res.Add.S7.S7Tag Execute(S7Tag request)
        {
            var s7Tag = _mapper.Map <Domain.Entity.S7.S7Tag>(request);

            _tagRepository.Add(s7Tag);
            var result = _unitOfWork.Commit();

            return(result == -1 ? new KSociety.Com.App.Dto.Res.Add.S7.S7Tag(Guid.Empty) : new KSociety.Com.App.Dto.Res.Add.S7.S7Tag(s7Tag.Id));
        }
        /// <summary>Reads the nbt's content from the <see cref="Stream"/></summary>
        /// <param name="tag">The tag to read from the <see cref="Stream"/></param>
        /// <param name="Context">The context that provides a buffer, the stream and endianness of the NBT</param>
        public void ReadContent(ITag tag, SerializationContext Context)
        {
            ITag SubTag = NBTReader.Read(Context);

            while (SubTag != null)
            {
                tag.Add(SubTag);
                SubTag = NBTReader.Read(Context);
            }
        }
        /// <summary>Transfers a list of items into a tag as sub tag intems</summary>
        /// <typeparam name="T">The type of items to transfer</typeparam>
        /// <param name="List">The tag to receive the new sub tags</param>
        /// <param name="SubType">The sub tag type, must implement this <see cref="ITag"/></param>
        /// <param name="Source">The source of items to transfer</param>
        private static void Transfer <T>(ITag List, Type SubType, List <T> Source)
        {
            Int32 Count = Source.Count;
            ITag  SubTag;

            for (Int32 I = 0; I < Count; I++)
            {
                SubTag = (ITag)Activator.CreateInstance(SubType);
                SubTag.SetValue(Source[I]);
                List.Add(SubTag);
            }
        }
예제 #6
0
        public void Tag_AddTest()
        {
            using (var uow = ObjectFactory.GetInstance <IUnitOfWork>())
            {
                var fileDo = CreateFileDo();
                var tagDo  = CreateTagDo(1, "key", "value");

                _tagService.Add(fileDo.Id, tagDo);

                var listTags = new List <TagDO>();
                var fileTags = uow.FileTagsRepository.FindList(x => x.FileDoId == fileDo.Id);
                foreach (var fileTag in fileTags)
                {
                    listTags.Add(fileTag.Tag);
                }

                Assert.IsTrue(listTags.Count == 1);
                Assert.IsTrue(listTags[0].Value == "value");
                Assert.IsTrue(listTags[0].Key == "key");
            }
        }
예제 #7
0
 public object TagAdd([FromBody] string name)
 {
     _Tag.Add(name);
     return(name);
 }
예제 #8
0
 public bool Add(E_Model.Tag model)
 {
     return(dal.Add(model));
 }
예제 #9
0
파일: Tag.cs 프로젝트: huangchanghu/iDisk
 /// <summary>
 /// 增加一条数据
 /// </summary>
 public void Add(Hch.iDisk.Model.Tag model)
 {
     dal.Add(model);
 }
예제 #10
0
 void IKvitto.AddTagInfo(Kvitto.ITagInfo tagInfo)
 {
     _tag.Add(tagInfo);
 }