Activities of "EngincanV"

Answer

Hi, we are using Bootstrap for our tag helpers, and abp-tab is no exception. You should be able to hide tabs with both display:none; and visibility: hidden;. Please share more information if the following info doesn't help you.


You can hide the first tab as follows for an example on the js side:

$("ul#PermissionsTabs > li:first").hide();

//or for completely hiding all the tabs
$("ul#PermissionsTabs").hide();

If you want to do this on the CSS side, then you can do the following:

ul #PermissionsTabs
{
    visibility: hidden !important; //or alternatively -> display: none !important;
}

Hi, yes you are right, there is a missing "steps" keyword before the invalid line. Here is the correct one:

# Docs for the Azure Web Apps Deploy action: https://github.com/Azure/webapps-deploy
# More GitHub Actions for Azure: https://github.com/Azure/actions

name: Build and deploy ASP.Net Core with BlazorServer to Azure Web App

on:
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Set up .NET Core
        uses: actions/setup-dotnet@v4
        with:
          dotnet-version: '8.x'
          include-prerelease: true

      - name: Install ABP CLI
        run: |
          dotnet tool install -g Volo.Abp.Cli
          abp install-libs
        shell: bash
    
      - name: Build with dotnet
        run: dotnet build --configuration Release

      - name: Run migrations
        run: dotnet run -- "${{ secrets.CONNECTION_STRING }}" # Set your connection string as a secret in your repository settings
        working-directory: ./src/blazorservertierdemo.DbMigrator  # Replace with your project name

      - name: dotnet publish apihost
        run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/apihost
        working-directory: ./src/blazorservertierdemo.HttpApi.Host # Replace with your project name

      - name: Generate authserver.pfx
        run: dotnet dev-certs https -v -ep ${{env.DOTNET_ROOT}}/apihost/authserver.pfx -p 2D7AA457-5D33-48D6-936F-C48E5EF468ED # Replace with your password

      - name: dotnet publish webapp
        run: dotnet publish -c Release -o ${{env.DOTNET_ROOT}}/webapp
        working-directory: ./src/blazorservertierdemo.Blazor # Replace with your project name

      - name: Upload artifact for apihost
        uses: actions/upload-artifact@v4
        with:
          name: .net-apihost
          path: ${{env.DOTNET_ROOT}}/apihost

      - name: Upload artifact for webapp
        uses: actions/upload-artifact@v4
        with:
          name: .net-webapp
          path: ${{env.DOTNET_ROOT}}/webapp

  deploy:
    runs-on: ubuntu-latest
    needs: build
    environment:
      name: 'Production'
      url: ${{ steps.deploy-to-webapp-3.outputs.webapp-url }}
    steps:  
      - name: Download artifact from apihost
        uses: actions/download-artifact@v4
        with:
          name: .net-apihost
          path: ./apihost

      - name: Deploy apihost
        id: deploy-to-webapp-2
        uses: azure/webapps-deploy@v3
        with:
          app-name: 'apihost-blazorserver' # Replace with your app name
          slot-name: 'Production'
          publish-profile: ${{ secrets.apihostblazorserverPublishSettings }} # Set your Azure Web App to publish your profile as a secret in your repository settings
          package: ./apihost

      - name: Download artifact from webapp
        uses: actions/download-artifact@v4
        with:
          name: .net-webapp
          path: ./webapp

      - name: Deploy webapp
        id: deploy-to-webapp-3
        uses: azure/webapps-deploy@v3
        with:
          app-name: 'webapp-blazorserver' # Replace with your app name
          slot-name: 'Production'
          publish-profile: ${{ secrets.webappblazorserverPublishSettings }} # Set your Azure Web App to publish your profile as a secret in your repository settings
          package: ./webapp

Anyway, I just thought I'd let someone know. Also, may want to update the dot-net version since version 9 is out now.

I have created an issue for that: https://github.com/abpframework/abp/issues/22061

I noticed that when I click on the Download Publish Profile, mine does not download and says "Basic Authentication is Disabled". Is this supposed to be like that?

Yes, it's disabled by default, if you want to enable it, please refer to the answer below:

https://learn.microsoft.com/en-us/answers/questions/1497453/how-to-download-publish-profile

Hi, to add more than 10 custom-code placeholders, you should edit templates and add the relevant placeholder for the related templates. Here are the documents that you can check to see how to do that:

  • https://abp.io/docs/latest/suite/customizing-the-generated-code#adding-new-custom-hook-points-changing-their-places-1
  • https://abp.io/docs/latest/suite/editing-templates

Can you provide me the docs related to this default behaviour of EF Core?

Sure. Here are two documentation that you can refer:

  • https://learn.microsoft.com/en-us/ef/core/modeling/relationships/one-to-one#required-one-to-one-without-cascade-delete
  • https://learn.microsoft.com/en-us/ef/core/saving/cascade-delete

Regards.

Hi @EngincanV,

I have created a 3rd example app, of the User & UserProfile example inside an ABP framework solution: https://cdn.fuzed.app/share/abp/AbpEFCorePlayground.zip

This time the SQL query loop occurs again, within ABP framework, using the same configuration as previous example. So I think this is some framework issue that needs to be fixed.

User entity:

using System; 
using Volo.Abp.Domain.Entities.Auditing; 
 
namespace AbpEFCorePlayground.Users; 
 
public class User : FullAuditedAggregateRoot<Guid> 
{ 
    public User( 
        Guid id, 
        string name) 
    { 
        Id = id; 
        Name = name; 
    } 
 
    private User() 
    { 
    } 
 
    public string Name { get; set; } 
 
    public UserProfile? Profile { get; set; } 
} 

UserProfile entity:

using System; 
using Volo.Abp.Domain.Entities.Auditing; 
 
namespace AbpEFCorePlayground.Users; 
 
public class UserProfile : FullAuditedEntity<Guid> 
{ 
    public Guid Id { get; set; } 
 
    public string Bio { get; set; } 
 
    public Guid UserId { get; set; } 
 
    public User User { get; set; } 
} 

UsersDataSeedContributor:

using System; 
using System.Threading.Tasks; 
using Volo.Abp.Data; 
using Volo.Abp.DependencyInjection; 
using Volo.Abp.Uow; 
 
namespace AbpEFCorePlayground.Users; 
 
public class UsersDataSeedContributor : IDataSeedContributor, ITransientDependency 
{ 
    private readonly IUserRepository _userRepository; 
 
    public UsersDataSeedContributor(IUserRepository userRepository) 
    { 
        _userRepository = userRepository; 
    } 
 
    [UnitOfWork] 
    public virtual async Task SeedAsync(DataSeedContext context) 
    { 
        User user = new User( 
            id: Guid.Parse("c64b873e-c067-43e0-ae00-07992a880837"), 
            name: "Steff Beckers") 
        { 
            Profile = new UserProfile() 
            { 
                Bio = "Software Developer" 
            } 
        }; 
 
        await _userRepository.DeleteAsync(x => x.Id == user.Id); 
        await _userRepository.InsertAsync(user); 
    } 
} 

EF entity configuration:

        builder.Entity<User>(b => 
        { 
            b.ToTable(AbpEFCorePlaygroundConsts.DbTablePrefix + "Users", AbpEFCorePlaygroundConsts.DbSchema); 
            b.ConfigureByConvention(); //auto configure for the base class props 
 
            b.HasOne(x => x.Profile) 
                .WithOne(x => x.User) 
                .HasForeignKey<UserProfile>(x => x.UserId) 
                .IsRequired() 
                .OnDelete(DeleteBehavior.Cascade); 
        }); 
 
        builder.Entity<UserProfile>(b => 
        { 
            b.ToTable(AbpEFCorePlaygroundConsts.DbTablePrefix + "UserProfiles", AbpEFCorePlaygroundConsts.DbSchema); 
            b.ConfigureByConvention(); //auto configure for the base class props 
        }); 
         
        Configure<AbpEntityOptions>(options => 
        { 
            options.Entity<User>(e => 
            { 
                e.DefaultWithDetailsFunc = query => query.Include(x => x.Profile); 
            }); 
        }); 

App service:

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Threading.Tasks; 
 
namespace AbpEFCorePlayground.Users; 
 
public class UsersAppService : AbpEFCorePlaygroundAppService, IUsersAppService 
{ 
    private readonly IUserRepository _userRepository; 
 
    public UsersAppService(IUserRepository userRepository) 
    { 
        this._userRepository = userRepository; 
    } 
 
    public async Task DeleteUserProfileAsync() 
    { 
        var user = await _userRepository.GetAsync(x => x.Id == Guid.Parse("c64b873e-c067-43e0-ae00-07992a880837")); 
 
        user.Profile = null; 
 
        await _userRepository.UpdateAsync(user); 
    } 
} 

Best regards, Steff Beckers

The problem is that you are setting the UserId as not nullable in the UserProfile, and this restricts you to set the user.Profile as null. This is default behaviour of EF Core. There is no problem in the ABP Framework side.You can try the same in a plain asp.net core application.

Also, the cascade-delete does not apply in the update scenarios. For example, if you delete the related user, the relevant profile will also be deleted, because of the cascade-delete option. However, setting a user's profile as null is not related to that. To be able to set it null, you should make it as optional. And if you want to ensure, setting it null also should delete the dependent 1-1 entity you should update your code according to that.

I've tested IsRequired(false) and it solves the query issue, but the Author itself isn't deleted. An author can't exist on its own in this case and now we have a "ghost" Author record, since BookId is now allowed to be NULL. So I don't think we should use IsRequired(false). IsRequired configures whether this is a required relationship (i.e. whether the foreign key property(s) can be assigned null). It doesn't ensure that a Book requires an Author. It only ensures that the FK is required/can't be NULL => an Author must have a BookId.

In your design, it's normal not to delete the author itself because while you are setting the author as null it just ensures it does not have any reference for the related author. So, the cascade delete option of EF Core does not work in that case.

I've created a new and better (relation wise) example using the ASP.NET Core Web API template, where the removal works as expected: https://cdn.fuzed.app/share/abp/EFCorePlayground.zip

Yes, this is what it should look like. Now you are defining the UserId as required and made it as not nullable, in the previous example, it was nullable and in that case, a SQL statement loop occurred.

Hi, can you please share what you have done to override the localization entries? For example, you might be followed this documentation, but the options might be configured between the debug pragma statements (e.g. #if DEBUG)

Or did you change the localization entries on the angular UI side? (https://abp.io/docs/latest/framework/ui/angular/localization) If you did, then the environment might not be set correctly.

In your db configuration it seems you set the one-to-one relationship as required, however, this is not what you want (because you made the Author as nullable (Author?)), so you should make the following change (set IsRequired(false)):

        builder.Entity<Book>(b =>
        {
            b.ToTable(AbpHardDeleteConsts.DbTablePrefix + "Books", AbpHardDeleteConsts.DbSchema);
            b.ConfigureByConvention(); //auto configure for the base class props
            b.HasOne(x => x.Author).WithOne(x => x.Book)
                .HasForeignKey<Author>(x => x.BookId)
-               .IsRequired()
+               .IsRequired(false)
                .OnDelete(DeleteBehavior.Cascade);
        });

If you don't change the configuration like that, you can't set the Author as null, and SQL query will be generated over and over again.

Hi, normally it should not be like that. It seems there is a mis-configuration in the database side. I will check your project and write you back asap.

Hi, thank you very much. I imagine this applies to all entities, but I would like to do it for just one entity.

Hi, when you do this the related placeholder will be applied to all of your index.js files. However, since you will only write your custom code for a single index.js file, the other placeholders will be empty and they will be shown as comment blocks. So, you will be able to write your custom code per file by your choice.

Showing 591 to 600 of 1369 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 25, 2025, 06:16
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.