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)); } }
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)); }
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 }); }
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)); }
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)); }
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)); }
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 }); }