示例#1
0
            public BinaryStorageClass AddFile(byte[] data, string name, string[] path, DateTime fileDateUtc, string fileContainerPath)
            {
                var nameTag         = _tagCache.AddOrGet(name);
                var originalPathTag = _tagCache.AddOrGet(fileContainerPath);
                var pathId          = _pathsCache.AddOrGet(path);

                var binary = new BinaryStorageClass
                {
                    Id                  = Guid.NewGuid(),
                    DateAdded           = DateTime.Now.ToUniversalTime(),
                    OriginalBinaryDate  = fileDateUtc,
                    OriginalFileNameTag = nameTag,
                    OriginalPathTag     = originalPathTag,
                    NameTag             = nameTag,
                    PathId              = pathId,
                };

                _binariesCache.Add(binary, data);

                return(binary);
            }
示例#2
0
        public int AddOrGet(IEnumerable <string> tags)
        {
            var ids = tags.Select(t => _tagCache.AddOrGet(t));

            return(AddOrGet(ids));
        }
示例#3
0
        public int AddOrGet(IEnumerable <string> tags)
        {
            var path = tags.Select(t => _tags.AddOrGet(t)).ToArray();

            return(AddOrGet(path));
        }