Ejemplo n.º 1
0
        public static OperationDto ToOperationDto(this Operation operation)
        {
            var to = new OperationDto {
                Name         = operation.Name,
                ResponseName = operation.IsOneWay ? null : operation.ResponseType.GetOperationName(),
                ServiceName  = operation.ServiceType.GetOperationName(),
                Actions      = operation.Actions,
                Routes       = operation.Routes.ToDictionary(x => x.Path.PairWith(x.AllowedVerbs)),
            };

            if (operation.RestrictTo != null)
            {
                to.RestrictTo = operation.RestrictTo.AccessibleToAny.ToList().ConvertAll(x => x.ToString());
                to.VisibleTo  = operation.RestrictTo.VisibleToAny.ToList().ConvertAll(x => x.ToString());
            }

            return(to);
        }
Ejemplo n.º 2
0
        public static OperationDto ToOperationDto(this Operation operation)
        {
            var to = new OperationDto {
                Name = operation.Name,
                ResponseName = operation.IsOneWay ? null : operation.ResponseType.GetOperationName(),
                ServiceName = operation.ServiceType.GetOperationName(),
                Actions = operation.Actions,
                Routes = operation.Routes.Map(x => x.Path),
            };
            
            if (operation.RestrictTo != null)
            {
                to.RestrictTo = operation.RestrictTo.AccessibleToAny.ToList().ConvertAll(x => x.ToString());
                to.VisibleTo = operation.RestrictTo.VisibleToAny.ToList().ConvertAll(x => x.ToString());
            }

            return to;
        }
Ejemplo n.º 3
0
        public static OperationDto ToOperationDto(this Operation operation)
        {
            var to = new OperationDto {
                Name = operation.Name,
                ResponseName = operation.IsOneWay ? null : operation.ResponseType.Name,
                ServiceName = operation.ServiceType.Name,
                Actions = operation.Actions,
                Routes = operation.Routes.ToDictionary(x => x.Path.PairWith(x.AllowedVerbs)),
            };
            
            if (operation.RestrictTo != null)
            {
                to.RestrictTo = operation.RestrictTo.AccessibleToAny.ToList().ConvertAll(x => x.ToString());
                to.VisibleTo = operation.RestrictTo.VisibleToAny.ToList().ConvertAll(x => x.ToString());
            }

            return to;
        }