Example #1
0
        public EntityPackTS?Construct([Required, FromBody] ConstructOperationRequest request)
        {
            var entityType = TypeLogic.GetType(request.type);

            var entity = OperationLogic.ServiceConstruct(entityType, request.GetOperationSymbol(entityType), request.args);

            return(entity == null ? null : SignumServer.GetEntityPack(entity));
        }
        public EntityPackTS Construct(ConstructOperationRequest request)
        {
            var type = TypeLogic.GetType(request.type);

            var entity = OperationLogic.ServiceConstruct(type, request.operarionSymbol, request.args);

            return(entity == null ? null : SignumServer.GetEntityPack(entity));
        }
        protected internal virtual Entity Construct(ConstructorContext ctx)
        {
            OperationInfo constructor = GetConstructor(ctx);

            var settings = GetSettings <ConstructorOperationSettingsBase>(ctx.Type, constructor.OperationSymbol);

            var result = settings != null && settings.HasConstructor ? settings.OnConstructor(newConstructorOperationContext.GetInvoker(ctx.Type)(constructor, ctx, settings)) :
                         OperationLogic.ServiceConstruct(ctx.Type, constructor.OperationSymbol);

            ctx.Controller.ViewData[ViewDataKeys.WriteEntityState] = true;

            return(result);
        }
Example #4
0
 public Entity Construct(Type type, OperationSymbol operationSymbol, params object[] args)
 {
     return(Return(MethodInfo.GetCurrentMethod(), operationSymbol.ToString(),
                   () => OperationLogic.ServiceConstruct(type, operationSymbol, args)));
 }