Exemple #1
0
        public static List <StaticResourceDto> AddCrudChildren(this StaticResourceDto resource)
        {
            var view = new StaticResourceDto(resource.ResourceOwner, $"{resource.Name}View", "View", $"{resource.State}.view",
                                             resource.Path, resource.IsPublic)
            {
                ParentState = resource.State
            };

            var create = new StaticResourceDto(resource.ResourceOwner, $"{resource.Name}Create", "Create",
                                               $"{resource.State}.create", resource.Path, resource.IsPublic)
            {
                ParentState = resource.State
            };

            var edit = new StaticResourceDto(resource.ResourceOwner, $"{resource.Name}Edit", "Edit",
                                             $"{resource.State}.edit",
                                             resource.Path, resource.IsPublic)
            {
                ParentState = resource.State
            };

            var delete = new StaticResourceDto(resource.ResourceOwner, $"{resource.Name}Delete", "Delete",
                                               $"{resource.State}.delete", resource.Path, resource.IsPublic)
            {
                ParentState = resource.State
            };

            return(new List <StaticResourceDto>()
            {
                view,
                create,
                edit,
                delete
            });
        }
Exemple #2
0
        public static StaticResourceDto AddChildren(this StaticResourceDto resource, string displayName, string stateName)
        {
            var children = new StaticResourceDto(resource.ResourceOwner, $"{resource.Name}{displayName}", displayName, stateName, resource.Path, resource.IsPublic)
            {
                ParentState = resource.State
            };

            return(children);
        }
Exemple #3
0
        public static StaticResourceDto AddDeleteChildren(this StaticResourceDto resource, ResourceOwner?resourceOwner = null)
        {
            var delete = new StaticResourceDto(resource.ResourceOwner, $"{resource.Name}Delete", "Delete",
                                               $"{resource.State}.delete", resource.Path, resource.IsPublic)
            {
                ParentState = resource.State
            };

            if (resourceOwner.HasValue)
            {
                delete.ResourceOwner = resourceOwner.GetValueOrDefault();
            }

            return(delete);
        }
Exemple #4
0
        public static StaticResourceDto AddViewChildren(this StaticResourceDto resource, ResourceOwner?resourceOwner = null)
        {
            var view = new StaticResourceDto(resource.ResourceOwner, $"{resource.Name}View", "View", $"{resource.State}.view",
                                             resource.Path, resource.IsPublic)
            {
                ParentState = resource.State
            };

            if (resourceOwner.HasValue)
            {
                view.ResourceOwner = resourceOwner.GetValueOrDefault();
            }

            return(view);
        }
Exemple #5
0
        public static StaticResourceDto AddEditChildren(this StaticResourceDto resource, ResourceOwner?resourceOwner = null)
        {
            var edit = new StaticResourceDto(resource.ResourceOwner, $"{resource.Name}Edit", "Edit",
                                             $"{resource.State}.edit", resource.Path, resource.IsPublic)
            {
                ParentState = resource.State
            };

            if (resourceOwner.HasValue)
            {
                edit.ResourceOwner = resourceOwner.GetValueOrDefault();
            }


            return(edit);
        }
Exemple #6
0
        public static StaticResourceDto AddParent(this StaticResourceDto resource, StaticResourceDto parent)
        {
            resource.ParentState = parent.State;

            return(resource);
        }
Exemple #7
0
        public static StaticResourceDto AddChildren(this StaticResourceDto resource, StaticResourceDto children)
        {
            children.ParentState = resource.State;

            return(children);
        }