示例#1
0
        /// <summary>
        /// Inserts one or more mail item entries in a single batched request.
        /// Use this method to reduce HTTP overhead when inserting many emails
        /// in a single transfer.
        /// </summary>
        /// <param name="domain">the domain into which to migrate mail</param>
        /// <param name="entries">the mail messages to batch insert</param>
        /// <returns>a <code>MailItemFeed</code> containing the results of the
        /// batch insertion</returns>
        public MailItemFeed Batch(string domain, string userName, MailItemEntry[] entries)
        {
            Uri batchUri = new Uri(AppsMigrationNameTable.AppsMigrationBaseFeedUri + "/" + domain +
                "/" + userName + mailFeedUriSuffix + batchFeedUriSuffix);
            MailItemFeed feed = new MailItemFeed(batchUri, this);

            foreach (MailItemEntry entry in entries)
            {
                feed.Entries.Add(entry);
            }

            return base.Batch(feed, batchUri) as MailItemFeed;
        }
        /// <summary>
        /// Inserts one or more mail item entries in a single batched request.
        /// Use this method to reduce HTTP overhead when inserting many emails
        /// in a single transfer.
        /// </summary>
        /// <param name="domain">the domain into which to migrate mail</param>
        /// <param name="entries">the mail messages to batch insert</param>
        /// <param name="userName">the user for whom this should be done</param>
        /// <returns>a <code>MailItemFeed</code> containing the results of the
        /// batch insertion</returns>
        public MailItemFeed Batch(string domain, string userName, List <MailItemEntry> entries)
        {
            Uri batchUri = new Uri(AppsMigrationNameTable.AppsMigrationBaseFeedUri + "/" + domain +
                                   "/" + userName + mailFeedUriSuffix + batchFeedUriSuffix);
            MailItemFeed feed = new MailItemFeed(batchUri, this);

            foreach (MailItemEntry entry in entries)
            {
                feed.Entries.Add(entry);
            }

            return(base.Batch(feed, batchUri) as MailItemFeed);
        }