Merging reference data does not work when using multibyte-charractors
karamem0 opened this issue · 1 comments
Hi,
I am using Beef with Entity Framework. I tried to initialize data into Reference data, but multibyte-charractors has been garbled.
I checked the logs and the INSERT query seems to be wrong.
INSERT INTO #temp ([Code], [Text], [CreatedDate], [CreatedBy], [UpdatedDate], [UpdatedBy], [IsActive], [SortOrder]) VALUES ('drafted', '下書き', ...)
The query does not use N prefix. The correct will be:
INSERT INTO #temp ([Code], [Text], [CreatedDate], [CreatedBy], [UpdatedDate], [UpdatedBy], [IsActive], [SortOrder]) VALUES (N'drafted', N'下書き', ...)
Hi @karamem0,
Bit of a long story, but Beef is in the final stages of a major version release; see https://github.com/Avanade/Beef#version-5
The end result is Beef has had significant refactoring to pull out the various capabilities to make them more reusable and more awesome, etc.; see https://github.com/Avanade/Beef/tree/version-5#composition
Part of this refactoring has been an improvement around the Entity Framework support; especially in more complex scenarios where entities have relationships, etc. Also, for the most part a custom Mapping
component has been introduced as an alternative to AutoMapper
to simplify/improve this aspect given complexities/challenges with using.
I have copied the existing My.Hr
sample; then created a new MyEf.Hr
sample which is an end-to-end Entity Framework demonstration and is worth a walkthrough to see the changes.
Overall, the resulting code generation output is also improved. However, unfortunately, there will be reasonable effort required to upgrade/migrate existing. The code-generation YAML for the most is largely unchanged (beyond name change) and will provide warnings for any attributes no longer being used.
Your multibyte error I have resolved in this latest version; published packages are in preview being preview-5
; for example: https://www.nuget.org/packages/Beef.CodeGen.Core/5.0.1-preview5. I will review and correct any outstanding issues with v4.x early in the New Year, but assume future focus is on v5.x going forward.
Thanks...