Base solution for your next web application

Activities of "BPNT.AT"

Thank you ist there a guideline how to implement custom repositories/dbcontext to use this extension? for asp net zero tempalte?

Thank you

Question

Hello,

We are using the asp.net core + Angular framework and having performance issues while inserting a huge object list.

The data entity structure ist flat, like

  public virtual string Name {get;set;}
  public virtual string Hostname {get;set;}
  .....

There are not relations or nested lists.

Currently we are sending the object list to a CreateList function which looks like:

   public async Task CreateList(List<CreateOrEditRawListDto> inputList)
    {
        foreach(var listItem in inputList)
        {
                swtich(listItem.Name)
                {
                        case "Test":
                                await CreateTestEntry(listItem);
                                break;
                         case "Test2":
                                await CreateTest2Entry(listItem);
                                break;
                          default:
                                 await CreateDefaultEntry(listItem);
                                 break;
                }
        }
    }
    
    public async Task CreateTestEntry(CreateOrEditRawListDto input)
    {
            TestEntry testEntry = new TestEntry();
            testEntry.Name = input.Name;
            ......
            
            await _testEntryRepository.InsertAsync(testEntry);
    }
    
    

I think this is not the best solution, because produces a lot of single Insert statements.

I´ve seen the EFCore BulkExtensions kit - are there a integration guide? Is there a plan to integrate a bulk-extension out of the box into the asp.net core template?

Thank you

Showing 1 to 2 of 2 entries