Example #1
0
        public IBlobMetadata CreateBlob(string name, int containerID)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            if (containerID < 1)
            {
                throw new ArgumentOutOfRangeException("containerID");
            }

            BlobMetadata blob = BlobMetadata.Create(name, containerID);

            return((IBlobMetadata)blob);
        }
Example #2
0
        internal static BlobMetadata Create(string name, int containerID)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            if (containerID < 1)
            {
                throw new ArgumentOutOfRangeException("containerID");
            }

            BlobMetadata metadata = new BlobMetadata()
            {
                ID                = 0,
                ContainerID       = containerID,
                Name              = name,
                IntegrityPosition = 0
            };

            return(metadata);
        }
Example #3
0
        public IBlobMetadata GetBlob(int id)
        {
            if (id <= 0)
            {
                throw new ArgumentOutOfRangeException("id");
            }

            this.Logger.WriteFormatMessage("GetBlob: Начало. id='{0}'", id);

            BlobMetadata blob = this.BlobAdapter.GetBlob(String.Format("[ID] = {0}", id));

            this.Logger.WriteMessage("GetBlob: Конец.");

            if (blob != null)
            {
                return((IBlobMetadata)blob);
            }
            else
            {
                return(null);
            }
        }
Example #4
0
        public IBlobMetadata GetBlob(int containerID, string name)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            this.Logger.WriteFormatMessage("GetBlob: Начало. containerID='{0}' name='{1}'", containerID, name);

            BlobMetadata blob = this.BlobAdapter.GetBlob(String.Format("[ContainerID] = {0} AND [Name] = N'{1}'", containerID, name));

            this.Logger.WriteMessage("GetBlob: Конец.");

            if (blob != null)
            {
                return((IBlobMetadata)blob);
            }
            else
            {
                return(null);
            }
        }