Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7789129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T21:12:19+00:00 2026-06-01T21:12:19+00:00

I’m currently working with the Exchange Web Services (EWS) API and am in the

  • 0

I’m currently working with the Exchange Web Services (EWS) API and am in the process of creating an adapter for common tasks such as syncing emails as well as fetching emails based on ids. I’m aware of how to create the adapter, however I’m a little unsure as how to handle return types.

For example, fetching items by id with EWS I use BindToItems(IEnumerable<ItemId> itemIds, Microsoft.Exchange.WebServices.Data.PropertySet propertySet) which has a return type of IEnumerable<GetItemResponse>.

So my question is do I create IExchangeServiceAdapter and mimic the function signatures that I want or do I create custom return types for everything? Meaning I would add something like public IEnumerable<CustomResponseType> BindToItems(IEnumerable<CustomItemIdType> itemIds, PropertySet propertySet).

This is all for enabling me to unit test my service and mock it out.

Edit

Perhaps a better question is, when creating service adapters (or wrappers or facades) do I create an adapter for everything including return types and parameters to only what I need? So say when binding items like is shown above and I only add in my CustomResponseType the few out of many properties that I require. This in turn would require me to create mapping between the real implementation (e.g. GetItemResponse) to my adapted implementation of CustomResponseType.

Are there any good C# samples that do what I’m trying to achieve?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T21:12:21+00:00Added an answer on June 1, 2026 at 9:12 pm

    I’m not that familiar with the Exchange Web Service API, but my preference in similar situations is to use custom return types, and use Automapper to transfer the data between the two object types.

    I think this provides some benefits:

    1. You only pass around the data that you need. Extra information that is unnecessary is left out of the equation.
    2. Reduced attack surface. Since there are no unnecessary fields to be ignored, you won’t be open to over-posting vulnerabilities.
    3. Reduced network traffic. Obviously.
    4. Combining data objects. There may be times when you want to return more data than what the built-in object provides. That can turn one call into two, or you have to make a custom object anyway.
    5. Black boxing Exchange. You won’t be exposing some of the inner workings of the EWS. This allows you to simplify or perhaps broaden the reach of your own service.

    The biggest drawback I can think of is versioning the interface. If you want to add properties, you’ll have to change your data contract. But that can happen with #4 above anyway.

    In the end, you’ll have to decide which way works best for your situation. And how to best solve the business problem at hand.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have thousands of HTML files to process using Groovy/Java and I need to
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.