Exemplo n.º 1
0
        public MultiOperationResponse DeleteMultiple([Required, FromBody] MultiOperationRequest request)
        {
            if (request.Setters.HasItems())
            {
                var errors = ForeachMultiple(request.Lites, lite =>
                {
                    var entity = lite.RetrieveAndForget();

                    MultiSetter.SetSetters(entity, request.Setters, PropertyRoute.Root(entity.GetType()));

                    var op = request.GetOperationSymbol(entity.GetType());

                    OperationLogic.ServiceDelete(entity, op, request.ParseArgs(op));
                });

                return(new MultiOperationResponse(errors));
            }
            else
            {
                var errors = ForeachMultiple(request.Lites, lite =>
                {
                    var op = request.GetOperationSymbol(lite.EntityType);
                    OperationLogic.ServiceDelete(lite, op, request.ParseArgs(op));
                });

                return(new MultiOperationResponse(errors));
            }
        }
Exemplo n.º 2
0
        public MultiOperationResponse DeleteMultiple([Required, FromBody] MultiOperationRequest request)
        {
            var errors = ForeachMultiple(request.lites, lite =>
                                         OperationLogic.ServiceDelete(lite, request.GetOperationSymbol(lite.EntityType), request.args));

            return(new MultiOperationResponse(errors));
        }
Exemplo n.º 3
0
        public MultiOperationResponse ExecuteMultiple(MultiOperationRequest request)
        {
            var errors = ForeachMultiple(request.lites, lite =>
                                         OperationLogic.ServiceExecuteLite(lite, request.GetOperationSymbol(lite.EntityType), request.args));

            return(new MultiOperationResponse {
                errors = errors
            });
        }
Exemplo n.º 4
0
        public EntityPackTS?ConstructFromMany([Required, FromBody] MultiOperationRequest request)
        {
            var type = request.Lites.Select(l => l.EntityType).Distinct().Only() ?? TypeLogic.GetType(request.Type);

            var op     = request.GetOperationSymbol(type);
            var entity = OperationLogic.ServiceConstructFromMany(request.Lites, type, op, request.ParseArgs(op));

            return(entity == null ? null : SignumServer.GetEntityPack(entity));
        }
Exemplo n.º 5
0
        public EntityPackTS ConstructFromMany([Required, FromBody] MultiOperationRequest request)
        {
            var type = request.lites.Select(l => l.EntityType).Distinct().Only() ?? TypeLogic.GetType(request.type);

            var entity = OperationLogic.ServiceConstructFromMany(request.lites, type, request.GetOperationSymbol(type), request.args);

            return(SignumServer.GetEntityPack(entity));
        }
Exemplo n.º 6
0
        public EntityPackTS ConstructFromMany(MultiOperationRequest request)
        {
            var type = request.type == null ? null : TypeLogic.GetType(request.type);

            var entity = OperationLogic.ServiceConstructFromMany(request.lites, type, request.GetOperationSymbol(type), request.args);

            return(SignumServer.GetEntityPack(entity));
        }
Exemplo n.º 7
0
        public MultiOperationResponse ConstructFromMultiple([FromBody] MultiOperationRequest request)
        {
            var errors = ForeachMultiple(request.lites, lite =>
                                         OperationLogic.ServiceConstructFromLite(lite, request.GetOperationSymbol(lite.EntityType), request.args));

            return(new MultiOperationResponse {
                errors = errors
            });
        }