Exemple #1
0
            protected override IEnumerable <IPersistenceObject> ExecuteServerCall(ZetboxContextImpl ctx, IEnumerable <IPersistenceObject> objectsToSubmit, IEnumerable <ObjectNotificationRequest> notificationRequests)
            {
                IEnumerable <IPersistenceObject> changedObjects;
                List <IStreamable> auxObjects;

                Result = ctx.proxy.InvokeServerMethod(
                    ctx,
                    ctx.GetInterfaceType(obj),
                    obj.ID,
                    name,
                    retValType,
                    parameterTypes,
                    parameter,
                    objectsToSubmit,
                    notificationRequests,
                    out changedObjects,
                    out auxObjects);

                if (Result != null && Result.GetType().IsIPersistenceObject())
                {
                    Result = ctx.AttachRespectingIsolationLevel((IPersistenceObject)Result);
                }
                else if (Result != null && Result.GetType().IsIList() && Result.GetType().FindElementTypes().Any(t => t.IsIPersistenceObject()))
                {
                    var lst = (IList)Result;
                    for (int i = 0; i < lst.Count; i++)
                    {
                        lst[i] = ctx.AttachRespectingIsolationLevel((IPersistenceObject)lst[i]);
                    }
                }

                if (auxObjects != null)
                {
                    foreach (IPersistenceObject auxObj in auxObjects)
                    {
                        ctx.AttachRespectingIsolationLevel(auxObj);
                    }
                }

                return(changedObjects);
            }
Exemple #2
0
        internal List <IDataObject> GetListOfCall(int ID, string propertyName)
        {
            ResetState();

            List <IStreamable> auxObjects;
            List <IDataObject> serviceResult = _proxy.GetListOf(_context, _type, ID, propertyName, out auxObjects).ToList();
            List <IDataObject> result        = new List <IDataObject>();

            foreach (IDataObject obj in serviceResult)
            {
                result.Add((IDataObject)_context.AttachRespectingIsolationLevel(obj));
            }

            foreach (IPersistenceObject obj in auxObjects)
            {
                _context.AttachRespectingIsolationLevel(obj);
            }

            _context.PlaybackNotifications();
            return(result);
        }