mirror of
https://github.com/nsnail/FreeSql.git
synced 2025-06-19 12:28:15 +08:00
#783 fix ExecuteMySqlBulkCopyAsync .net core 3.1 Method not found
This commit is contained in:
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user