Skip to content

Commit

Permalink
Merge pull request #159 from Ali-YousefiTelori/develop
Browse files Browse the repository at this point in the history
Support for AddBulk in Report
  • Loading branch information
Ali-YousefiTelori authored Feb 14, 2024
2 parents ce472c0 + 0f4b123 commit 78d7a81
Show file tree
Hide file tree
Showing 8 changed files with 208 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,51 @@ protected virtual Func<IQueryable<TEntity>, IQueryable<TEntity>> OnGetAllQuery()
{
return null;
}
}


/// <summary>
///
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TResponseContract"></typeparam>
/// <typeparam name="TLanguageResponseContract"></typeparam>
/// <typeparam name="TId"></typeparam>
public class MultilingualReadableQueryServiceController<TEntity, TResponseContract, TLanguageResponseContract, TId>
: MultilingualReadableQueryServiceController<TEntity, FilterRequestContract, TResponseContract, TLanguageResponseContract, TId>
where TResponseContract : class
where TLanguageResponseContract : class
where TEntity : class
{

/// <summary>
///
/// </summary>
/// <param name="contractReadable"></param>
public MultilingualReadableQueryServiceController(IContractReadableLogic<TEntity, TResponseContract, TId> contractReadable)
: base(contractReadable)
{

}

/// <summary>
///
/// </summary>
/// <param name="unitOfWork"></param>
/// <param name="contractReadable"></param>
public MultilingualReadableQueryServiceController(IBaseUnitOfWork unitOfWork, IContractReadableLogic<TEntity, TResponseContract, TId> contractReadable)
: base(unitOfWork, contractReadable)
{

}
/// <summary>
///
///
/// </summary>
/// <param name="unitOfWork"></param>
public MultilingualReadableQueryServiceController(IBaseUnitOfWork unitOfWork)
: base(unitOfWork)
{
ContractLogic = unitOfWork.GetReadableContractLogic<TEntity, TResponseContract, TId>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using EasyMicroservices.Cores.Contracts.Requests;
using EasyMicroservices.Cores.Database.Interfaces;
using EasyMicroservices.Cores.Interfaces;
using EasyMicroservices.Database.Interfaces;
using EasyMicroservices.ServiceContracts;
using Microsoft.AspNetCore.Mvc;
using System;
Expand Down Expand Up @@ -154,4 +153,49 @@ protected virtual Func<IQueryable<TEntity>, IQueryable<TEntity>> OnGetAllQuery()
return null;
}
}

/// <summary>
///
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TResponseContract"></typeparam>
/// <typeparam name="TId"></typeparam>
public class ReadableQueryServiceController<TEntity, TResponseContract, TId>
: ReadableQueryServiceController<TEntity, FilterRequestContract, TResponseContract, TId>
where TResponseContract : class
where TEntity : class
{

/// <summary>
///
/// </summary>
/// <param name="contractReadable"></param>
public ReadableQueryServiceController(IContractReadableLogic<TEntity, TResponseContract, TId> contractReadable)
: base(contractReadable)
{

}

/// <summary>
///
/// </summary>
/// <param name="unitOfWork"></param>
/// <param name="contractReadable"></param>
public ReadableQueryServiceController(IBaseUnitOfWork unitOfWork, IContractReadableLogic<TEntity, TResponseContract, TId> contractReadable)
: base(unitOfWork, contractReadable)
{

}

/// <summary>
///
///
/// </summary>
/// <param name="unitOfWork"></param>
public ReadableQueryServiceController(IBaseUnitOfWork unitOfWork)
: base(unitOfWork)
{

}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using EasyMicroservices.Cores.Database.Interfaces;
using EasyMicroservices.Database.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;

Expand All @@ -22,4 +23,12 @@ public static void SetIdToRecordId<TEntity, TRecordEntity>(IContext context, TEn
throw new Exception($"I cannot find any primary key in your {typeof(TEntity).Name}!");
idProperty.SetValue(recordEntity, ids.First());
}

public static void SetIdToRecordId<TEntity, TRecordEntity>(IContext context, Dictionary<TEntity, TRecordEntity> records)
{
foreach (var item in records)
{
SetIdToRecordId(context, item.Key, item.Value);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EasyMicroservices.Cores.Interfaces;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace EasyMicroservices.Cores.Database.Interfaces;
Expand All @@ -17,8 +18,16 @@ public interface IDatabaseWidget<TEntity, T> : IWidget<T>
/// </summary>
/// <param name="databaseWidgetManager"></param>
/// <param name="baseUnitOfWork"></param>
/// <param name="contract"></param>
/// <param name="entity"></param>
/// <param name="contract"></param>
/// <returns></returns>
Task AddProcess(IDatabaseWidgetManager databaseWidgetManager, IBaseUnitOfWork baseUnitOfWork, TEntity entity, T contract);
/// <summary>
///
/// </summary>
/// <param name="databaseWidgetManager"></param>
/// <param name="baseUnitOfWork"></param>
/// <param name="items"></param>
/// <returns></returns>
Task Process(IDatabaseWidgetManager databaseWidgetManager, IBaseUnitOfWork baseUnitOfWork, T contract, TEntity entity);
Task AddBulkProcess(IDatabaseWidgetManager databaseWidgetManager, IBaseUnitOfWork baseUnitOfWork, Dictionary<T, TEntity> items);
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EasyMicroservices.Cores.Interfaces;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace EasyMicroservices.Cores.Database.Interfaces;
Expand All @@ -13,9 +14,19 @@ public interface IDatabaseWidgetManager : IWidgetManager
/// <typeparam name="T"></typeparam>
/// <typeparam name="TEntity"></typeparam>
/// <param name="baseUnitOfWork"></param>
/// <param name="contract"></param>
/// <param name="entity"></param>
/// <param name="contract"></param>
/// <returns></returns>
Task Add<TEntity, T>(IBaseUnitOfWork baseUnitOfWork, TEntity entity, T contract)
where TEntity : class;
/// <summary>
///
/// </summary>
/// <typeparam name="T"></typeparam>
/// <typeparam name="TEntity"></typeparam>
/// <param name="baseUnitOfWork"></param>
/// <param name="items"></param>
/// <returns></returns>
Task Add<T, TEntity>(IBaseUnitOfWork baseUnitOfWork, T contract, TEntity entity)
Task AddBulk<TEntity, T>(IBaseUnitOfWork baseUnitOfWork, Dictionary<T, TEntity> items)
where TEntity : class;
}
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ protected async Task<ListMessageContract<TContract>> Filter<TEntity, TContract>(
var entityResult = await Filter(filterRequest, easyReadableQueryable, query, cancellationToken);
if (!entityResult)
return entityResult.ToAnotherListContract<TContract>();
var result = (ListMessageContract<TContract>)await MapToListAsync<TContract, TEntity>(entityResult.Result);
var result = (ListMessageContract<TContract>)await MapToListAsync<TEntity, TContract>(entityResult.Result);
result.TotalCount = entityResult.TotalCount;
return result;
}
Expand Down Expand Up @@ -509,7 +509,7 @@ protected async Task<ListMessageContract<TContract>> GetAll<TEntity, TContract>(
var entityResult = await GetAll(easyReadableQueryable, query, cancellationToken);
if (!entityResult)
return entityResult.ToAnotherListContract<TContract>();
var result = await MapToListAsync<TContract, TEntity>(entityResult.Result);
var result = await MapToListAsync<TEntity, TContract>(entityResult.Result);
return result;
}

Expand All @@ -533,7 +533,7 @@ public async Task<ListMessageContract<TContract>> GetAllByUniqueIdentity<TEntity
var entityResult = await GetAll(queryable, query, cancellationToken);
if (!entityResult)
return entityResult.ToAnotherListContract<TContract>();
var result = await MapToListAsync<TContract, TEntity>(entityResult.Result);
var result = await MapToListAsync<TEntity, TContract>(entityResult.Result);
return result;
}

Expand Down Expand Up @@ -703,7 +703,7 @@ public async Task<MessageContract<TContract>> Update<TEntity, TUpdateContract, T
public async Task<MessageContract> UpdateBulk<TEntity, TUpdateContract>(IEasyWritableQueryableAsync<TEntity> easyWritableQueryable, UpdateBulkRequestContract<TUpdateContract> request, bool updateOnlyChangedValue, CancellationToken cancellationToken = default)
where TEntity : class
{
var entities = await MapToListAsync<TEntity, TUpdateContract>(request.Items);
var entities = await MapToListAsync<TUpdateContract, TEntity>(request.Items);
var result = await InternalUpdateBulk(easyWritableQueryable, entities, updateOnlyChangedValue, false, true, false, cancellationToken);
return result;
}
Expand Down Expand Up @@ -974,7 +974,7 @@ await InternalUpdate(easyWritableQueryable, result.Entity, false, true, true, tr
}
}
var widgetManager = _baseUnitOfWork.GetDatabaseWidgetManager();
await widgetManager.Add(_baseUnitOfWork, contract, result.Entity);
await widgetManager.Add(_baseUnitOfWork, result.Entity, contract);
await ActivityChangeLogLogic.AddAsync(result.Entity, _baseUnitOfWork);
return result.Entity;
}
Expand All @@ -983,14 +983,15 @@ await InternalUpdate(easyWritableQueryable, result.Entity, false, true, true, tr
///
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="TContract"></typeparam>
/// <param name="easyWritableQueryable"></param>
/// <param name="entities"></param>
/// <param name="items"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
public async Task<ListMessageContract<TEntity>> AddBulk<TEntity>(IEasyWritableQueryableAsync<TEntity> easyWritableQueryable, IEnumerable<TEntity> entities, CancellationToken cancellationToken = default)
internal async Task<ListMessageContract<TEntity>> AddBulk<TEntity, TContract>(IEasyWritableQueryableAsync<TEntity> easyWritableQueryable, Dictionary<TContract,TEntity> items, CancellationToken cancellationToken = default)
where TEntity : class
{
var result = await easyWritableQueryable.AddBulkAsync(entities, cancellationToken);
var result = await easyWritableQueryable.AddBulkAsync(items.Values, cancellationToken);
var allItems = easyWritableQueryable.Context.GetTrackerEntities().ToArray();
await CheckUniqueIdentityAccess(allItems).AsCheckedResult();

Expand Down Expand Up @@ -1025,7 +1026,9 @@ await InternalUpdateBulk(easyWritableQueryable, result.Select(x => x.Entity).ToL
await easyWritableQueryable.SaveChangesAsync();
}
var response = result.Select(x => x.Entity).ToList();
await ActivityChangeLogLogic.AddBulkAsync(response, _baseUnitOfWork);
var widgetManager = _baseUnitOfWork.GetDatabaseWidgetManager();
await widgetManager.AddBulk(_baseUnitOfWork, items);
await ActivityChangeLogLogic.AddBuldAsync(response, _baseUnitOfWork);

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / format

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'

Check failure on line 1031 in src/CSharp/EasyMicroservices.Cores.Database/Database/Logics/DatabaseLogicInfrastructure.cs

View workflow job for this annotation

GitHub Actions / os-tests

'ActivityChangeLogLogic' does not contain a definition for 'AddBuldAsync'
return response;
}

Expand All @@ -1042,7 +1045,7 @@ public async Task<MessageContract<TEntity>> Add<TEntity, TContract>(IEasyWritabl
where TEntity : class
{
var entity = await MapAsync<TEntity, TContract>(contract);
var result = await Add<TEntity, TContract>(easyWritableQueryable, entity, contract, cancellationToken);
var result = await Add(easyWritableQueryable, entity, contract, cancellationToken);
return result;
}

Expand All @@ -1058,8 +1061,8 @@ public async Task<MessageContract<TEntity>> Add<TEntity, TContract>(IEasyWritabl
public async Task<ListMessageContract<TEntity>> AddBulk<TEntity, TContract>(IEasyWritableQueryableAsync<TEntity> easyWritableQueryable, CreateBulkRequestContract<TContract> request, CancellationToken cancellationToken = default)
where TEntity : class
{
var entities = await MapToListAsync<TEntity, TContract>(request.Items);
var result = await AddBulk(easyWritableQueryable, entities, cancellationToken);
var items = await MapToDictionaryAsync<TContract, TEntity>(request.Items);
var result = await AddBulk(easyWritableQueryable, items, cancellationToken);
return result;
}

Expand All @@ -1074,7 +1077,7 @@ public async Task<ListMessageContract<TEntity>> AddBulk<TEntity, TContract>(IEas
/// <typeparam name="TFrom"></typeparam>
/// <param name="items"></param>
/// <returns></returns>
protected async Task<List<TTo>> MapToListAsync<TTo, TFrom>(IEnumerable<TFrom> items)
protected async Task<List<TTo>> MapToListAsync<TFrom,TTo>(IEnumerable<TFrom> items)
{
if (typeof(TFrom) == typeof(TTo))
return items.Cast<TTo>().ToList();
Expand All @@ -1083,6 +1086,22 @@ protected async Task<List<TTo>> MapToListAsync<TTo, TFrom>(IEnumerable<TFrom> it
return result;
}

/// <summary>
///
/// </summary>
/// <typeparam name="TFrom"></typeparam>
/// <typeparam name="TTo"></typeparam>
/// <param name="items"></param>
/// <returns></returns>
protected async Task<Dictionary<TFrom,TTo>> MapToDictionaryAsync<TFrom,TTo>(IEnumerable<TFrom> items)
{
if (typeof(TFrom) == typeof(TTo))
return items.Cast<object>().ToDictionary(x => (TFrom)x, x => (TTo)x);
var result = await MapperProvider.MapToDictionaryAsync<TFrom, TTo>(items);
ValidateMappedResult(ref result);
return result;
}

/// <summary>
///
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using EasyMicroservices.Cores.Database.Interfaces;
using EasyMicroservices.Cores.Interfaces;
using EasyMicroservices.Cores.Widgets;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Threading.Tasks;

namespace EasyMicroservices.Cores.Database.Managers;
Expand All @@ -16,18 +18,38 @@ public class DatabaseWidgetManager : WidgetManager, IDatabaseWidgetManager
/// <typeparam name="T"></typeparam>
/// <typeparam name="TEntity"></typeparam>
/// <param name="baseUnitOfWork"></param>
/// <param name="contract"></param>
/// <param name="entity"></param>
/// <param name="contract"></param>
/// <returns></returns>
public async Task Add<T, TEntity>(IBaseUnitOfWork baseUnitOfWork, T contract, TEntity entity)
public async Task Add<TEntity, T>(IBaseUnitOfWork baseUnitOfWork, TEntity entity, T contract)
where TEntity : class
{
var widgets = GetWidgetsByType(typeof(T));
foreach (var widget in widgets)
{
if (widget is IDatabaseWidget<TEntity, T> databaseWidget && databaseWidget.CanProcess(baseUnitOfWork))
{
await databaseWidget.Process(this, baseUnitOfWork, contract, entity);
await databaseWidget.AddProcess(this, baseUnitOfWork, entity, contract);
}
}
}

/// <summary>
///
/// </summary>
/// <typeparam name="TEntity"></typeparam>
/// <typeparam name="T"></typeparam>
/// <param name="baseUnitOfWork"></param>
/// <param name="items"></param>
/// <returns></returns>
public async Task AddBulk<TEntity, T>(IBaseUnitOfWork baseUnitOfWork, Dictionary<T, TEntity> items) where TEntity : class
{
var widgets = GetWidgetsByType(typeof(T));
foreach (var widget in widgets)
{
if (widget is IDatabaseWidget<TEntity, T> databaseWidget && databaseWidget.CanProcess(baseUnitOfWork))
{
await databaseWidget.AddBulkProcess(this, baseUnitOfWork, items);
}
}
}
Expand Down
Loading

0 comments on commit 78d7a81

Please sign in to comment.