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); }
public int AddOrGet(IEnumerable <string> tags) { var ids = tags.Select(t => _tagCache.AddOrGet(t)); return(AddOrGet(ids)); }
public int AddOrGet(IEnumerable <string> tags) { var path = tags.Select(t => _tags.AddOrGet(t)).ToArray(); return(AddOrGet(path)); }