You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have an existing database from which we reverse engineer a model (i.e using the scaffold command to point at the existing tables)
We occasional repeat this command to update our model from changes made directly to the database.
We also have some customisations that we need to preserve for particular entities.
In order to preserve them, we place them in a partial class:
FooEntity.cs
FooEntity.partial.cs
However, suppose we move the property definition for particular column, into the partial class:
private int _FooTypeId;
public int FooTypeId
{
get { return _FooTypeId; }
set
{
_FooTypeId= value;
OnPropertyChanged(nameof(FooTypeId));
}
}
When we next run the command to reverse engineer the database, the reverse engineering process isn't clever enough to see that the property already exists in the partial class, and so it adds it again on the main class:
public int FooTypeId { get; set; }
This happens with many properties, and so each time we run the command, we have to go though and remove all these duplicate property definitions.
Any solution for this?
The text was updated successfully, but these errors were encountered:
We have an existing database from which we reverse engineer a model (i.e using the
scaffold
command to point at the existing tables)We occasional repeat this command to update our model from changes made directly to the database.
We also have some customisations that we need to preserve for particular entities.
In order to preserve them, we place them in a
partial
class:However, suppose we move the property definition for particular column, into the partial class:
When we next run the command to reverse engineer the database, the reverse engineering process isn't clever enough to see that the property already exists in the partial class, and so it adds it again on the main class:
This happens with many properties, and so each time we run the command, we have to go though and remove all these duplicate property definitions.
Any solution for this?
The text was updated successfully, but these errors were encountered: