Open Closed

Entity manager classes created by ABP suite #3331


User avatar
0
ademaygun created
  • ABP Framework version: v5.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

I create an entity with Abp Suite. Update method was created like this:

public async Task<<Product>> UpdateAsync(
            Guid id,
            string type
        )
        {
            var queryable = await _productRepository.GetQueryableAsync();
            var query = queryable.Where(x => x.Id == id);

            var product = await AsyncExecuter.FirstOrDefaultAsync(query);

            product.Type = type;

            return await _productRepository.UpdateAsync(product);
        }

Why isn't the method created like this?

public async Task<<Product>> UpdateAsync(
            Guid id,
            string type
        )
        {
            var product  = await _productRepository.GetAsync(id);
            product.Type = type;

            return await _productRepository.UpdateAsync(product);
        }
Markdown supported.
Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)

2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I will feedback to the SUITE team.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
  • User Avatar
    0
    alper created
    Support Team Director

    thanks for your feedback. the generated code looks complex for the standard inputs. but this format is designed to support navigation properties (1-n, n-n). that's why it looks ugly. I created an internal issue (10906) to make an enhancement on this code.

    Markdown supported.
    Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on September 09, 2026, 11:56
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.