Share via


MappedEntityDomainManager<TData, TModel> Class

 

Provides an IDomainManager<TData> implementation targeting SQL as the backend store using Entity Framework where there is not a 1:1 mapping between the data object (DTO) exposed through a TableController<TData> and the domain model managed by SQL. See EntityDomainManager<TData> for situations where there is a 1:1 relationship between the Data Object (DTO) and the domain model managed by SQL.

Namespace:   Microsoft.WindowsAzure.Mobile.Service
Assembly:  Microsoft.WindowsAzure.Mobile.Service.Entity (in Microsoft.WindowsAzure.Mobile.Service.Entity.dll)

Inheritance Hierarchy

System.Object
  Microsoft.WindowsAzure.Mobile.Service.MappedEntityDomainManager<TData, TModel>

Syntax

public abstract class MappedEntityDomainManager<TData, TModel> : IDomainManager<TData>
where TData : class, ITableData
where TModel : class
generic<typename TData, typename TModel>
where TData : ref class, ITableData
where TModel : ref class
public ref class MappedEntityDomainManager abstract : IDomainManager<TData>
[<AbstractClass>]
type MappedEntityDomainManager<'TData, 'TModel when 'TData : not struct and ITableData when 'TModel : not struct> = 
    class
        interface IDomainManager<'TData>
    end
Public MustInherit Class MappedEntityDomainManager(Of TData As { Class, ITableData }, TModel As Class)
    Implements IDomainManager(Of TData)

Type Parameters

  • TData
    The data object (DTO) type.
  • TModel
    The type of the domain data model

Constructors

Name Description
System_CAPS_protmethod MappedEntityDomainManager<TData, TModel>(DbContext, HttpRequestMessage, ApiServices)

Properties

Name Description
System_CAPS_pubproperty Context

System_CAPS_pubproperty Request

System_CAPS_pubproperty Services

Methods

Name Description
System_CAPS_pubmethod DeleteAsync(String)

System_CAPS_protmethod DeleteItemAsync(Object[])

System_CAPS_pubmethod Equals(Object)

(Inherited from Object.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_protmethod GetCompositeKey(String)

System_CAPS_pubmethod GetHashCode()

(Inherited from Object.)

System_CAPS_protmethod GetKey<TKey>(String)

System_CAPS_protmethod GetKey<TKey>(String, CultureInfo)

System_CAPS_protmethod GetOriginalValue(DbUpdateConcurrencyException)

Gets the original value of an entity in case an update or replace operation resulted in an DbUpdateConcurrencyException. The original value extracted from the exception will get returned to the client so that it can merge the data and possibly try the operation again.

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod InsertAsync(TData)

System_CAPS_pubmethod Lookup(String)

System_CAPS_protmethod LookupEntity(Expression<Func<TModel, Boolean>>)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_pubmethod Query()

System_CAPS_pubmethod ReplaceAsync(String, TData)

System_CAPS_protmethod SetOriginalVersion(TModel, Byte[])

Override this method to support optimistic concurrent updates and replace operations. In order to evaluate whether an object has been updated concurrently, Entity Framework needs to know the original version of the object being edited and compare that to the current version maintained in the database. This requires that the original value is known by Entity Framework so that it can ask the database to do the check.

System_CAPS_protmethod SubmitChangesAsync()

Submits the change through Entity Framework while logging any exceptions and produce appropriate HttpResponseMessage instances.

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_pubmethod UpdateAsync(String, Delta<TData>)

System_CAPS_protmethod UpdateEntityAsync(Delta<TData>, Object[])

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod IDomainManager<TData>.LookupAsync(String)

System_CAPS_pubinterfaceSystem_CAPS_privmethod IDomainManager<TData>.QueryAsync(ODataQueryOptions)

Remarks

The MappedEntityDomainManager<TData, TModel> leverages AutoMapper to map between the DTO and the domain model and it is assumed that AutoMapper has already been initialized with appropriate mappings that map from DTO =&amp;gt; domain model and from domain model =&amp;gt; DTO. The bi-directional mapping is required for both reads (GET, QUERY) and updates (PUT, POST, DELETE, PATCH) to function.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Microsoft.WindowsAzure.Mobile.Service Namespace

Return to top