using Microsoft.Extensions.DependencyInjection; using Opsoft.Data; using Opsoft.NetCore.O3App.Domain; using Opsoft.NetCore.O3App.Domain.Interface; using Opsoft.NetCore.O3App.Domain.UnitOfWork.WMS.IRepositories; using Opsoft.NetCore.O3App.Shared; using System; using System.Collections.Generic; using System.Text; using System.Threading.Tasks; namespace Opsoft.NetCore.O3App.Repositories.WMS { [MapTo(typeof(IProductBarcodeCheckRepository), ServiceLifetime.Transient)] public class ProductBarcodeCheckRepository : RepositoryBase, IProductBarcodeCheckRepository { public ProductBarcodeCheckRepository() : base() { } public async Task> ExecuteAsync(Dictionary sqlList) { await using APPServerContext dbContext = new APPServerContext(LoginInfo.DBAias, LoginInfo.UserID); List errorBarcode = new List(); foreach (var sql in sqlList) { if (await dbContext.Database.SqlNonQueryAsync(sql.Value) <= 0) { errorBarcode.Add(sql.Key); } } return errorBarcode; } } }