|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Text; |
| 5 | +using System.Threading.Tasks; |
| 6 | +using Csla.Channels.Local; |
| 7 | +using Csla.DataPortalClient; |
| 8 | +using Csla.Server; |
| 9 | + |
| 10 | +namespace Csla.Test.Fakes.Server.DataPortal |
| 11 | +{ |
| 12 | + /// <summary> |
| 13 | + /// Fake proxy implementation that can be used to represent a remote proxy |
| 14 | + /// for testing, without the need to step outside of the AppDomain |
| 15 | + /// </summary> |
| 16 | + internal class FakeRemoteDataPortalProxy : IDataPortalProxy |
| 17 | + { |
| 18 | + private readonly LocalProxy _implementingProxy; |
| 19 | + |
| 20 | + public FakeRemoteDataPortalProxy(LocalProxy implementingProxy) |
| 21 | + { |
| 22 | + _implementingProxy = implementingProxy; |
| 23 | + } |
| 24 | + |
| 25 | + public bool IsServerRemote { get => true; } |
| 26 | + |
| 27 | + public Task<DataPortalResult> Create(Type objectType, object criteria, DataPortalContext context, bool isSync) |
| 28 | + => _implementingProxy.Create(objectType, criteria, context, isSync); |
| 29 | + |
| 30 | + public Task<DataPortalResult> Delete(Type objectType, object criteria, DataPortalContext context, bool isSync) |
| 31 | + => _implementingProxy.Delete(objectType, criteria, context, isSync); |
| 32 | + |
| 33 | + public Task<DataPortalResult> Fetch(Type objectType, object criteria, DataPortalContext context, bool isSync) |
| 34 | + => _implementingProxy.Fetch(objectType, criteria, context, isSync); |
| 35 | + |
| 36 | + public Task<DataPortalResult> Update(object obj, DataPortalContext context, bool isSync) |
| 37 | + => _implementingProxy.Update(obj, context, isSync); |
| 38 | + } |
| 39 | +} |
0 commit comments