Search found 111 matches

by RobertK
Mon 02 May 2022 01:51
Forum: Entity Developer
Topic: BUG FOUND: Column always required when set to null
Replies: 5
Views: 11082

Re: BUG FOUND: Column always required when set to null

RobertK wrote: Sun 01 May 2022 16:45 There is still a bug in in the class models code generated by devart entity developer

The class models generated does not set nullible columns to null (question mark symbol) When the column are not set to nullible, Dotnet ef migration will set the column to required, see link below.

----
https://docs.microsoft.com/en-us/ef/cor ... onventions
By convention, a property whose .NET type can contain null will be configured as optional, whereas properties whose .NET type cannot contain null will be configured as required. For example, all properties with .NET value types (int, decimal, bool, etc.) are configured as required, and all properties with nullable .NET value types (int?, decimal?, bool?, etc.) are configured as optional.
Setting "Nullable Reference Types" to enable resolved this issue.
by RobertK
Sun 01 May 2022 16:45
Forum: Entity Developer
Topic: BUG FOUND: Column always required when set to null
Replies: 5
Views: 11082

Re: BUG FOUND: Column always required when set to null

There is still a bug in in the class models code generated by devart entity developer

The class models generated does not set nullible columns to null (question mark symbol) When the column are not set to nullible, Dotnet ef migration will set the column to required, see link below.

----
https://docs.microsoft.com/en-us/ef/cor ... onventions
By convention, a property whose .NET type can contain null will be configured as optional, whereas properties whose .NET type cannot contain null will be configured as required. For example, all properties with .NET value types (int, decimal, bool, etc.) are configured as required, and all properties with nullable .NET value types (int?, decimal?, bool?, etc.) are configured as optional.
by RobertK
Sat 05 Jun 2021 13:10
Forum: Entity Developer
Topic: How to configure navigation property naming format?
Replies: 7
Views: 3197

Re: How to configure navigation property naming format?

Ideally would want this navigation properties naming pattern
(example only, does not represent a realworld database design)

Image
by RobertK
Sat 05 Jun 2021 07:48
Forum: Entity Developer
Topic: How to configure navigation property naming format?
Replies: 7
Views: 3197

Re: How to configure navigation property naming format?

I'm still unable to correctly configure the navigation properties.

Example
You have two class models CreditCard and Address
CreditCard has a foreignkey called "BillingAddress"

>CreditCard
Id
Name
Number
...
BillingAddressId <-- foreign key to "Address"
--
>Navigation Properties
BillingAddress <-- (this is the correct name, it is the name of the column without "ID", by default this nagivation property is set to "Address")

>Address
Id
Name
...
>Navigation Properties
CreditCards_BillingAddress <-- (this is the correct name, it is the name of the foreignkey class model underscore column name without ID, by default this nagivation property is set to "CreditCards")
by RobertK
Thu 03 Jun 2021 17:28
Forum: Entity Developer
Topic: URGENT: critical bug, generated code differs from diagram models
Replies: 11
Views: 4810

Re: URGENT: critical bug, generated code differs from diagram models

Shalex wrote: Fri 28 May 2021 04:56
RobertK wrote: Wed 26 May 2021 18:17 It's a bug, so it's often inconsistent,... It was reported here viewtopic.php?f=32&t=45661&sid=c08446ac ... e1c6142c7b
Regenerate Storage and Mapping Wizard in EF Core Model will help to fix inconsistency of the existing model.

Could you tell us the steps we should follow with a brand-new EF Core Model to reproduce inconsistency caused by Entity Developer?
Was the bug fixed? Regenerate storage and mapping should fix it but it didn't, if there's an updated version, will try that.
by RobertK
Wed 26 May 2021 18:17
Forum: Entity Developer
Topic: BUG FOUND: Column always required when set to null
Replies: 5
Views: 11082

Re: BUG FOUND: Column always required when set to null

Shalex wrote: Tue 25 May 2021 12:47 We will fix the functionality of Regenerate Storage and Mapping Wizard in EF Core Model and notify you.
Thanks
by RobertK
Wed 26 May 2021 18:17
Forum: Entity Developer
Topic: URGENT: critical bug, generated code differs from diagram models
Replies: 11
Views: 4810

Re: URGENT: critical bug, generated code differs from diagram models

Shalex wrote: Tue 25 May 2021 13:04
RobertK wrote: Sun 23 May 2021 06:13 Is it possible to always make entity developer generated code match the class model diagram? (instead entity developer generating code that sometimes match the diagram and sometimes it does not match, its often inconsistent)
Settings of a class property should always be consistent with the ones of the corresponding column using both Model-First and Database-First approaches if you leave default settings created by Entity Developer. Please give us a step-by-step walkthrough we should follow to reproduce inconsistency in our environment.
It's a bug, so it's often inconsistent,... It was reported here viewtopic.php?f=32&t=45661&sid=c08446ac ... e1c6142c7b
by RobertK
Sun 23 May 2021 06:13
Forum: Entity Developer
Topic: URGENT: critical bug, generated code differs from diagram models
Replies: 11
Views: 4810

Re: URGENT: critical bug, generated code differs from diagram models

Shalex wrote: Thu 25 Mar 2021 17:48 ...
Is it possible to always make entity developer generated code match the class model diagram? (instead entity developer generating code that sometimes match the diagram and sometimes it does not match, its often inconsistent)
by RobertK
Sat 22 May 2021 17:58
Forum: Entity Developer
Topic: URGENT: critical bug, generated code differs from diagram models
Replies: 11
Views: 4810

Re: URGENT: critical bug, generated code differs from diagram models

Regenerate model and remapping still has issues as reported here viewtopic.php?f=32&t=45661

Alternative solution is to clear selection of the Not Null attribute in Column Editor: https://prnt.sc/10vafdl. <-- I can not do this because I don't know which column follows or does not the model diagram, it's very difficult determine if the generated code is correct aswell because it is not always consistent with the model diagram and I can't fix this either,its a very big problem.
by RobertK
Sat 22 May 2021 15:09
Forum: Entity Developer
Topic: BUG FOUND: Column always required when set to null
Replies: 5
Views: 11082

BUG FOUND: Column always required when set to null

v6.11.1219

Download zip file: https://filebin.net/t4kbp61pvwd7tnbq


Tried using regenerate storage and remapping, this should fix the issue, but it does not fix this issue?

ApplicationDbContext.cs: the error occurs in the address table, column "name", the model displays name is nullable, when the code is generated "name" is always required (line 130)

Generated code:
"modelBuilder.Entity<Address>().Property(x => x.Name).HasColumnName(@"Name").IsRequired().ValueGeneratedNever();"

It should be:
modelBuilder.Entity<Address>().Property(x => x.Name).HasColumnName(@"Name").ValueGeneratedNever();

Code: Select all

        private void AddressMapping(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Address>().ToTable(@"Addresses", @"public");
            modelBuilder.Entity<Address>().Property(x => x.Id).HasColumnName(@"Id").IsRequired().ValueGeneratedNever();
            modelBuilder.Entity<Address>().Property(x => x.AccountId).HasColumnName(@"AccountId").IsRequired().ValueGeneratedNever();
            modelBuilder.Entity<Address>().Property(x => x.Name).HasColumnName(@"Name").IsRequired().ValueGeneratedNever();
            modelBuilder.Entity<Address>().Property(x => x.Company).HasColumnName(@"Company").ValueGeneratedNever();
  ......
        }
Note
---------
EntityDeveloper should update the efml file from not-null="True" to not-null="False" but it does not do this (even when the model is regenerated using "regenerate storage and remapping" option)

Code: Select all

    <property name="Name" type="String" p1:nullable="True" p1:ValidateRequired="false" p1:Guid="e4076478-def9-42fe-9d3c-a7b3bf68b179">
      <column name="" not-null="True" p1:unicode="True" />
by RobertK
Tue 11 May 2021 07:54
Forum: Entity Developer
Topic: Storing JSON objects
Replies: 3
Views: 3075

Re: Storing JSON objects

what would you select for the datatype? jsonobject?

https://pasteboard.co/K1mNhHp.png
by RobertK
Tue 04 May 2021 12:15
Forum: Entity Developer
Topic: Storing JSON objects
Replies: 3
Views: 3075

Storing JSON objects

database: postgres

In Entity Developer, what column data type do you use to store JSON objects?
by RobertK
Thu 15 Apr 2021 16:33
Forum: Entity Developer
Topic: Entity Developer vs DotConnect - whats the difference?
Replies: 1
Views: 2710

Entity Developer vs DotConnect - whats the difference?

1 What is the difference between entity developer and dot connect? https://www.devart.com/dotconnect/

2 Could you also design and generate code in dotconnect?
by RobertK
Thu 15 Apr 2021 16:31
Forum: Entity Developer
Topic: URGENT: critical bug, generated code differs from diagram models
Replies: 11
Views: 4810

Re: URGENT: critical bug, generated code differs from diagram models

Shalex wrote: Thu 25 Mar 2021 17:48
RobertK wrote: Tue 23 Mar 2021 14:49 The root cause of this issue (the efml information are saved incorrectly)
p1:nullable="True" <-- this is right
not-null="True" <-- this is wrong it should be saved as "not-null="False" because the column is set to nullable.

Code: Select all

    <property name="MetaData" type="String" p1:nullable="True" p1:ValidateRequired="false" p1:Guid="6a3e0473-d959-4044-ac85-dce9ad4a18d4">
      <column name="meta_data" not-null="True" sql-type="varchar" p1:unicode="True" />
This will generated the incorrect mapping

Code: Select all

            modelBuilder.Entity<Card>().Property(x => x.MetaData).HasColumnName(@"meta_data").HasColumnType(@"varchar").IsRequired().ValueGeneratedNever();
To fix the issue, please clear selection of the Not Null attribute in Column Editor: https://prnt.sc/10vafdl.

After this, the generated code would be:

Code: Select all

            modelBuilder.Entity<Card>().Property(x => x.MetaData).HasColumnName(@"meta_data").HasColumnType(@"varchar").ValueGeneratedNever();
Also, you can run Regenerate Storage and Mapping to clear data in Column Editor for all properties: https://prnt.sc/10vaibd.

thanks this fixed the problem.
by RobertK
Tue 23 Mar 2021 15:11
Forum: Entity Developer
Topic: URGENT: critical bug, generated code differs from diagram models
Replies: 11
Views: 4810

Re: Generated code differs from design models - 2

Note: this issue does not occur with only one class model, this issue affects hundred of tables, diagram does not match the code/table generated.