Ejemplo n.º 1
0
        /// <summary>
        /// Creates a <see cref="BusinessObject"/> of a selected type.
        /// </summary>
        /// <param name="type">The type of <see cref="IBusinessObject"/> to create.</param>
        /// <param name="requestXml">Client requestXml containing initial parameters for the object.</param>
        /// <returns>A new <see cref="IBusinessObject"/>.</returns>
        public override IBusinessObject CreateNewBusinessObject(BusinessObjectType type, XDocument requestXml)
        {
            IBusinessObject bo = null;

            switch (type)
            {
            case BusinessObjectType.FileDescriptor:
                bo = this.CreateNewFileDescriptor();
                break;

            default:
                throw new InvalidOperationException("RepositoryMapper can only create fileDescriptors.");
            }

            bo.GenerateId();
            return(bo);
        }