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 | |
---|---|---|
MappedEntityDomainManager<TData, TModel>(DbContext, HttpRequestMessage, ApiServices) |
Properties
Name | Description | |
---|---|---|
Context | ||
Request | ||
Services |
Methods
Name | Description | |
---|---|---|
DeleteAsync(String) | ||
DeleteItemAsync(Object[]) | ||
Equals(Object) | (Inherited from Object.) |
|
Finalize() | (Inherited from Object.) |
|
GetCompositeKey(String) | ||
GetHashCode() | (Inherited from Object.) |
|
GetKey<TKey>(String) | ||
GetKey<TKey>(String, CultureInfo) | ||
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. |
|
GetType() | (Inherited from Object.) |
|
InsertAsync(TData) | ||
Lookup(String) | ||
LookupEntity(Expression<Func<TModel, Boolean>>) | ||
MemberwiseClone() | (Inherited from Object.) |
|
Query() | ||
ReplaceAsync(String, TData) | ||
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. |
|
SubmitChangesAsync() | Submits the change through Entity Framework while logging any exceptions and produce appropriate HttpResponseMessage instances. |
|
ToString() | (Inherited from Object.) |
|
UpdateAsync(String, Delta<TData>) | ||
UpdateEntityAsync(Delta<TData>, Object[]) |
Explicit Interface Implementations
Name | Description | |
---|---|---|
IDomainManager<TData>.LookupAsync(String) | ||
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 =&gt; domain model and from domain model =&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