CSLA.NET 5.4.2
CSLA .NET is a software development framework that helps you build a reusable, maintainable object-oriented business layer for your app.
ServicedDataPortalRepeatableRead.cs
Go to the documentation of this file.
1#if !NETFX_CORE && !MONO && !(ANDROID || IOS) && !NETSTANDARD2_0 && !NET5_0
2//-----------------------------------------------------------------------
3// <copyright file="ServicedDataPortal.cs" company="Marimer LLC">
4// Copyright (c) Marimer LLC. All rights reserved.
5// Website: https://cslanet.com
6// </copyright>
7// <summary>Implements the server-side Serviced </summary>
8//-----------------------------------------------------------------------
9using System;
10using System.EnterpriseServices;
11using System.Runtime.InteropServices;
12using System.Threading.Tasks;
13
14namespace Csla.Server
15{
20 [Transaction(TransactionOption.Required, Isolation = System.EnterpriseServices.TransactionIsolationLevel.RepeatableRead)]
21 [EventTrackingEnabled(true)]
22 [ComVisible(true)]
23 public class ServicedDataPortalRepeatableRead : ServicedComponent, IDataPortalServer
24 {
42 [AutoComplete(true)]
43 public async Task<DataPortalResult> Create(
44 Type objectType, object criteria, DataPortalContext context, bool isSync)
45 {
46 var portal = new DataPortalBroker();
47 return await portal.Create(objectType, criteria, context, isSync).ConfigureAwait(false);
48 }
49
64 [AutoComplete(true)]
65 public async Task<DataPortalResult> Fetch(Type objectType, object criteria, DataPortalContext context, bool isSync)
66 {
67 var portal = new DataPortalBroker();
68 return await portal.Fetch(objectType, criteria, context, isSync).ConfigureAwait(false);
69 }
70
84 [AutoComplete(true)]
85 public async Task<DataPortalResult> Update(object obj, DataPortalContext context, bool isSync)
86 {
87 var portal = new DataPortalBroker();
88 return await portal.Update(obj, context, isSync).ConfigureAwait(false);
89 }
90
104 [AutoComplete(true)]
105 public async Task<DataPortalResult> Delete(Type objectType, object criteria, DataPortalContext context, bool isSync)
106 {
107 var portal = new DataPortalBroker();
108 return await portal.Delete(objectType, criteria, context, isSync).ConfigureAwait(false);
109 }
110 }
111}
112#endif
Allows the Data Portal call to be intercepted by a custom IDataPortalServer implementation.
Provides consistent context information between the client and server DataPortal objects.
Implements the server-side Serviced DataPortal described in Chapter 4.
async Task< DataPortalResult > Delete(Type objectType, object criteria, DataPortalContext context, bool isSync)
Wraps a Delete call in a ServicedComponent.
async Task< DataPortalResult > Update(object obj, DataPortalContext context, bool isSync)
Wraps an Update call in a ServicedComponent.
async Task< DataPortalResult > Fetch(Type objectType, object criteria, DataPortalContext context, bool isSync)
Wraps a Fetch call in a ServicedComponent.
async Task< DataPortalResult > Create(Type objectType, object criteria, DataPortalContext context, bool isSync)
Wraps a Create call in a ServicedComponent.
Interface implemented by server-side data portal components.