Mapping between Database Types and Client Types in the .NET Backend using AutoMapper!!!!

Posted on

Most of the samples showing how to use the .NET Backend have a single type that represents both the data stored in the database and the data that is exposed to the service callers. However, sometimes you cannot expose your database data as-is, or you want to provide and accept extra data to callers that should not be in the database.

The .NET backend is strongly-typed, so in those situations, you must map your data between the database type and the client type. For example:

  • You have extra information in your database table that you do not want to expose publicly, such as a Salary field.
  • You have an existing database table that you want to expose through Mobile Services, but the table’s shape in “wrong” in some way (the Id property is not a string, missing some of the members needed byITableData, etc.)
  • You want the expose the information from a database columns in a different way, such as expose a start date as a string (like “May 2013”) instead of as a DateTimeOffset object.

To read more about this, click here:

http://blogs.msdn.com/b/azuremobile/archive/2014/05/19/mapping-between-database-types-and-client-type-in-the-net-backend-using-automapper.aspx

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s