Base solution for your next web application

Activities of "Astech"

Is there any reason why we could not consolidate there attributes and just have one for system wide authorization? Or is it necessary to use a different one in the MVC project to the application service?

Thanks

Hi,

I think you can directly use an if statement instead of combaning strings.

Could you give an example?

I'm trying to access a string from this object property:

"#if(" + (IsGranted("#=EntitySearch.ViewPermissionName#")).ToString().ToLower() + "){#" +

But I'm getting the following error as it's trying to search for the literal string instead of the property.

Abp.AbpException: There is no permission with name: #=EntitySearch.ViewPermissionName#

This works fine so I'm wondering if it's the IsGranted wrapper breaking it?

"#=EditModalButtonTemplate('EntitySearch.EditModalFunctionName', EntitySearch.Id)#"

The full grid:

                    @(Html.Kendo().Grid<SearchViewModel>().Name("EntitySearchList")
                        .DataSource(dataSource => dataSource
                            .Custom()
                            .Transport(transport =>  { transport.Read(read => read.Url(@Url.Action("Search_Read", "Searches")).DataType("json").Data("additionalData")); })
                            .Schema(schema => { schema.Model(m => m.Id("EntitySearchModel.Id")); schema.Data("Result.Result.Data").Total("Result.Result.Total"); })
                        )
                        .Columns(columns =>
                        {
                            columns.Bound(p => p.EntitySearch.Id).Title(" ").Filterable(false).Sortable(false).IncludeInMenu(false).HtmlAttributes(new { @class = "actions-column-cell" }).ClientTemplate(

                            "#if(" + (IsGranted("#=EntitySearch.ViewPermissionName#")).ToString().ToLower() + "){#" +

                            "#=ViewLinkButtonTemplate('" + @Url.Action("EntitySearch.ControllerViewFunctionName", "EntitySearch.ControllerName") + "', EntitySearch.Id" + ")#" +

                            "#}" +

                            "#=EditModalButtonTemplate('EntitySearch.EditModalFunctionName', EntitySearch.Id)#" +

                            "#=HistoryModalButtonTemplate(EntitySearch.Id, EntitySearch.Name, '" + @EntityTypeFullNames.Team.ToString() + "')#");

                            columns.Bound(p => p.EntitySearch.Id).IncludeInMenu(false);
                            columns.Bound(p => p.EntitySearch.SearchTypeDisplayName).IncludeInMenu(false);
                            columns.Bound(p => p.EntitySearch.Name).IncludeInMenu(false);
                        })
                        .Pageable()
                        .Events(events => events.DataBound("onDataBound"))
                        .NoRecords(x => x.Template("<div class='empty-grid'>" + string.Format(@L("NoSomethingFound"),@L("CompletedActions").ToLower()) + "</div>"))

                    )

Yes both the Id of the parent and child match

We are trying to map an object with its child collection:

This always used to work, however all of a sudden we cannot map child collections. Can anyone help?

Is there anything else we can do about the size of this file? It just seems to be a list of all our app services. The solution I have provided above allows it to be cached, however, it is still a very large file to be loading on initial load.

Thanks

We have resolved the issue by generating the file only once on application start. Saving it in the wwwroot and referencing that instead. This is allowing the file to be cached:

    public void GenerateScripts()
    {
        var output = GetAll(new ApiProxyGenerationModel() { Minify = true, Type = "jquery" });
        string fullFileLocation = Path.Combine(Directory.GetCurrentDirectory(), @"wwwroot\Common\Scripts", "AbpServiceProxies.min.js");
        using (FileStream fs = new System.IO.FileStream(fullFileLocation, FileMode.Create))
        {
            StreamWriter writer = new StreamWriter(fs);
            writer.Write(_javaScriptMinifier.Minify(output.Content));
            writer.Close();
        }

Thank you to **apchenjun **for his solution on this thread: https://github.com/aspnetboilerplate/aspnetboilerplate/issues/5379

Hi ismcagdas, thanks for your reply.

It is 55mb when minified which is still crazy to be loading on every page load.

I can create a custom controller but how will this help with caching/load times?

Thanks Scott

It seems that alot of the js and css files we have are not being cached at all and have no-cache, no-store on them:

How do we resolve this please?

We have the following file loading on every page load. It is incredibly large and causing long delays. Can anyone shine a light on why this is needed, why it is so large and what we can do to rectify the situation please? Thank you. (Image alt text: /AbpServiceProxies/GetAll - 59MB)

Showing 1 to 10 of 72 entries