#783 fix ExecuteMySqlBulkCopyAsync .net core 3.1 Method not found

This commit is contained in:
luoyunchong
2021-06-01 19:42:19 +08:00
parent ea8d0bb58c
commit 82c9d1e12a
4 changed files with 34 additions and 3 deletions

View File

@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;
namespace FreeSql.Tests.Provider.MySqlConnector
{
public class FreeSqlMySqlConnectorGlobalExtensionsTest
{
class BulkCopyValue
{
public Guid id { get; set; }
public DateTime createtime { get; set; }
}
[Fact]
public async Task ExecuteMySqlBulkCopyAsync()
{
var fsql = g.mysql;
fsql.CodeFirst.SyncStructure<BulkCopyValue>();
List<BulkCopyValue> bulkCopyValues = new List<BulkCopyValue>();
for (var i = 0; i < 1000; i++)
{
bulkCopyValues.Add(new BulkCopyValue() { createtime = DateTime.Now });
}
await fsql.Insert<BulkCopyValue>().AppendData(bulkCopyValues).ExecuteMySqlBulkCopyAsync();
}
}
}