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);
        }
                        2 Answer(s)
- 
    0
hi
I will feedback to the SUITE team.
 - 
    0
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.