Comments (14)
Hello @007gzs , @serifreedom ,
The v3.12.16 has been released.
https://www.nuget.org/packages/Z.EntityFramework.Extensions/
We added the support to column type uint
. As Entity Framework do, we bind it to type long
Let me know if the new version has fixed this issue on your side.
Best Regards,
Jonathan
from entityframework-extensions.
Hello @007gzs ,
For my knowledge, Entity Framework doesn't support LazyType at all?
By example, using the following code, Entity Framework will skip the LazyColumnInt
property
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Windows.Forms;
namespace Z.EntityFramework.Extensions.Lab
{
public partial class Form_Request_LazyType : Form
{
public Form_Request_LazyType()
{
InitializeComponent();
// CLEAN
using (var ctx = new CurrentContext())
{
ctx.Parents.RemoveRange(ctx.Parents);
ctx.SaveChanges();
}
// SEED
// TEST
using (var ctx = new CurrentContext())
{
var list = new List<Parent>();
for (var i = 0; i < 10; i++)
{
var i2 = i;
list.Add(new Parent { ID = 1 + i * 3, ColumnInt = i, LazyColumnInt = new Lazy<int>(() => i2)});
}
ctx.Parents.AddRange(list);
ctx.SaveChanges();
}
}
public class CurrentContext : DbContext
{
public CurrentContext()
: base("CodeFirstEntities")
{
}
public DbSet<Parent> Parents { get; set; }
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
modelBuilder.Types().Configure(x => x.ToTable(GetType().DeclaringType != null ? GetType().DeclaringType.FullName.Replace(".", "_") + "_" + x.ClrType.Name : ""));
base.OnModelCreating(modelBuilder);
}
}
public class Parent
{
public int ID { get; set; }
public int ColumnInt { get; set; }
public Lazy<int> LazyColumnInt { get; set; }
}
}
}
Do you think you could provide us a working example using SaveChanges
to let us investigate this issue?
Best Regards,
Jonathan
from entityframework-extensions.
It's not problem in method SaveChanges(Tested work fine) , which is default DbContext method.
It's error in "BulkInsert" extension method while using EntityFramework + your EntityFramework-Extensions + MySql, Database First Models on Table
CREATE TABLE
sales
(
entity_id
int(11) NOT NULL AUTO_INCREMENT,
type
varchar(32) DEFAULT NULL,
account
varchar(32) CHARACTER SET latin1 DEFAULT NULL,
pay_date
date DEFAULT NULL,
merch_number
varchar(32) DEFAULT NULL,
order_sl
varchar(50) DEFAULT NULL,
trans_code
varchar(32) DEFAULT NULL,
trans_date
date DEFAULT NULL,
amount
decimal(12,2) DEFAULT NULL,
store_name
varchar(255) DEFAULT NULL,
shot_code
varchar(32) DEFAULT NULL,
gold_code
varchar(24) DEFAULT NULL,
batch_export
varchar(24) DEFAULT NULL,
PRIMARY KEY (entity_id
),
UNIQUE KEYentity_id_UNIQUE
(entity_id
),
KEYIDX_SALES_ORDER_SL
(order_sl
)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8
I guess the error because it's miss match datatype entity_id
int(11) between EF-Ex and MySql
Please Help ASAP!.
from entityframework-extensions.
Hello @serifreedom ,
Thank you, we misread this issue the first time.
We will investigate this issue today and probably release a fix this night.
Best Regards,
Jonathan
from entityframework-extensions.
@JonathanMagnan , Unfortunately, It's still error! but with another type! or did i do anything wrong?
CREATE TABLE `sales_interface_order_tmp3` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(32) DEFAULT NULL,
`bank_account` varchar(32) CHARACTER SET latin1 DEFAULT NULL,
`mer_number` varchar(32) DEFAULT NULL,
`order_sl` varchar(50) DEFAULT NULL,
`trans_code` varchar(32) DEFAULT NULL,
`store_name` varchar(255) DEFAULT NULL,
`shot_code` varchar(32) DEFAULT NULL,
`gold_code` varchar(24) DEFAULT NULL,
`batch` varchar(24) DEFAULT NULL,
PRIMARY KEY (`entity_id`),
KEY `IDX_SALES_INTERFACE_ORDER_TMP3_ORDER_SL` (`shopee_order_sl`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8
Thank you.
from entityframework-extensions.
Hello @serifreedom ,
Thank you, we made sure this time all unsigned type is supported!
The v3.12.16 has been released.
https://www.nuget.org/packages/Z.EntityFramework.Extensions/
Let me know if all type issue is fixed.
Best Regards,
Jonathan
from entityframework-extensions.
@JonathanMagnan ,Thank you for quick release. But!
Again...,What is this error? not data type mapping anymore,Now I guess EF-Ex confusing connection between MS SQL and MySQL, I'm using both Db server in the same project with separate connections/DbContext/Models.
Any Idea?
from entityframework-extensions.
Hello @serifreedom ,
I just tried in a project (MySQL + SQL Server) and it works fine on my side.
Do you believe you could create a project that has this error and send it to us ([email protected])? Or give us a hint to reproduce it.
Best Regards,
Jonathan
from entityframework-extensions.
Hello @JonathanMagnan,
I will try create project for you to reproduce error later, What's different between default SaveChanges
and BulkInsert
? SaveChanges
always complete!, It's the same Dbcontext/Connection. Is EF-Ex require any special/full permission to Db?
FYI,exception thrown access denied for 'user@[my LAN ip]' instead of [server ip] from connection string!?
from entityframework-extensions.
Hello @serifreedom ,
I'm not sure yet was is causing this issue since we cannot reproduce it. I believe it may be caused by something we cache in the library and the unique key (with the context added) is the same for both context.
I believe it will be very easy to find once we receive the project.
Best Regards,
Jonathan
from entityframework-extensions.
Hello @serifreedom ,
Did you succeed to create the project?
Best Regards,
Jonathan
from entityframework-extensions.
Hello @JonathanMagnan,
Found the problem, No need sample project. Like I have asked you before, EF-Ex required ALL PRIVILEGES permission on Database for LOCK TABLES, if use BulkInsert :
LOCK TABLES TableA WRITE, TableA AS DestinationTable READ;
But BulkSaveChanges no need to LOCK TABLES. Wondering why...
I think this issue might be solved.
from entityframework-extensions.
Hello @serifreedom ,
I have looked at it today. BulkSaveChanges
also require LOCK TABLES
on insert if the table has an identity value.
Best Regards,
Jonathan
from entityframework-extensions.
Hello @serifreedom ,
Feel free to reopen if you have more question.
Best Regards,
Jonathan
from entityframework-extensions.
Related Issues (20)
- Npgsql.PostgresException: 23505: duplicate key value violates unique constraint HOT 6
- EF CORE 8 and Pgsql 8: Parameter without name in synchronize & merge HOT 3
- BulkInsert Error after upgrading to Ef Core .Net 8 with latest Extensions HOT 2
- BulkInsert Exception using NpgSql and jsonb in .NET 8 HOT 11
- Trial for EF core 7 HOT 3
- BulkInsert taking 20+ min for 80 000 data rows HOT 3
- Force output does not work for merge. HOT 3
- Invalid Cast. The update expression must be of type MemberInitExpression. HOT 3
- Bulk Operations for Postgres does not respect the PermanentTable setting HOT 2
- Avoid Prepared Statements for Bulk operations HOT 6
- WhereBulkContains throwing System.ArgumentNullException: 'Value cannot be null. (Parameter 'name')' HOT 15
- BulkUpdate and BulkMerge Do Not Apply Any Changes To The Table with Owned Entity HOT 1
- BulkSaveChanges results in Foreign Key Constraint Violation but SaveChanges works HOT 3
- BulkMerge is Causing Violation of PRIMARY KEY constraint HOT 1
- BulkInsert: System.IndexOutOfRangeException: 'There is no row at position 0.' HOT 4
- While inserting new record through BulkMerge it's not overriding default constraint value HOT 3
- The type initializer for 'Z.BulkOperations.LicenseManager' threw an exception HOT 13
- `PublicExtensions` static dictionaries are filling up HOT 4
- SQLite Invalid cast from 'System.String' to 'System.Guid' HOT 4
- IDbCommandInterceptor does not fire when using BulkInsert or BulkDelete HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from entityframework-extensions.