10using System.Collections.Generic;
15using System.Threading.Tasks;
17using System.Security.Principal;
39 dataPortalServer = dataPortal;
47#pragma warning disable 1998
49#pragma warning restore 1998
71 var dpr = await dataPortalServer.
Create(objectType, criteria, context,
true);
73 if (dpr.Error !=
null)
75 result.ObjectData = SerializationFormatterFactory.GetFormatter(
ApplicationContext).Serialize(dpr.ReturnObject);
93#pragma warning disable 1998
95#pragma warning restore 1998
117 var dpr = await dataPortalServer.
Fetch(objectType, criteria, context,
true);
119 if (dpr.Error !=
null)
121 result.ObjectData = SerializationFormatterFactory.GetFormatter(
ApplicationContext).Serialize(dpr.ReturnObject);
139#pragma warning disable 1998
141#pragma warning restore 1998
157 var dpr = await dataPortalServer.
Update(obj, context,
true);
159 if (dpr.Error !=
null)
162 result.ObjectData = SerializationFormatterFactory.GetFormatter(
ApplicationContext).Serialize(dpr.ReturnObject);
180#pragma warning disable 1998
182#pragma warning restore 1998
204 var dpr = await dataPortalServer.
Delete(objectType, criteria, context,
true);
206 if (dpr.Error !=
null)
208 result.ObjectData = SerializationFormatterFactory.GetFormatter(
ApplicationContext).Serialize(dpr.ReturnObject);
224 private static object GetCriteria(
ApplicationContext applicationContext,
byte[] criteriaData)
226 object criteria =
null;
227 if (criteriaData !=
null)
228 criteria = SerializationFormatterFactory.GetFormatter(applicationContext).Deserialize(criteriaData);
234 #region Extention Method for Requests
266 #endregion Extention Method for Requests
Csla.Server.DataPortalContext DataPortalContext
Provides consistent context information between the client and server DataPortal objects.
object CreateInstanceDI(Type objectType, params object[] parameters)
Creates an object using 'Activator.CreateInstance' using service provider (if one is available) to po...
object CreateInstance(Type objectType, params object[] parameters)
Creates an object using Activator.
Dictionary type that is serializable with the SerializationFormatterFactory.GetFormatter().
Class used as a wrapper for criteria based requests that use primitives
Message sent to the WCF data portal.
string ClientCulture
Serialized client culture.
byte[] CriteriaData
Serialized data for the criteria object.
string TypeName
Assembly qualified name of the business object type to create.
byte[] ClientContext
Serialized data for the client context object.
byte[] Principal
Serialized data for the principal object.
string ClientUICulture
Serialized client UI culture.
Message containing details about any server-side exception.
Response message for returning the results of a data portal call.
Request message for updating a business object.
byte[] ClientContext
Serialized data for the client context object.
string ClientCulture
Serialized client culture.
byte[] ObjectData
Serialized object data.
string ClientUICulture
Serialized client UI culture.
byte[] Principal
Serialized data for the principal object.
Exposes server-side DataPortal functionality through HTTP request/response.
async Task< DataPortalResponse > Create(CriteriaRequest request)
Create and initialize an existing business object.
virtual DataPortalResponse ConvertResponse(DataPortalResponse response)
Override to convert the response data after it comes back from the network.
async Task< DataPortalResponse > Delete(CriteriaRequest request)
Delete a business object.
async Task< DataPortalResponse > Update(UpdateRequest request)
Update a business object.
virtual UpdateRequest ConvertRequest(UpdateRequest request)
Override to convert the request data before it is transferred over the network.
HttpPortal(ApplicationContext applicationContext, IDataPortalServer dataPortal)
Creates an instance of the type
async Task< DataPortalResponse > Fetch(CriteriaRequest request)
Get an existing business object.
virtual CriteriaRequest ConvertRequest(CriteriaRequest request)
Override to convert the request data before it is transferred over the network.
Interface implemented by server-side data portal components.
Task< DataPortalResult > Update(object obj, DataPortalContext context, bool isSync)
Update a business object.
Task< DataPortalResult > Create(Type objectType, object criteria, DataPortalContext context, bool isSync)
Create a new business object.
Task< DataPortalResult > Fetch(Type objectType, object criteria, DataPortalContext context, bool isSync)
Get an existing business object.
Task< DataPortalResult > Delete(Type objectType, object criteria, DataPortalContext context, bool isSync)
Delete a business object.