Thanks for your response mates.
#2: It seem that this is a solution everyone refer.
However, I modified many things in other web forms.
Therefore, I don’t want regenerating whole project, while this action will overwrite
all my modified webforms in my current
project folder (I call this is
folder A).
I choice to regenerate the only table tblOffender in which I
deleted CountryOfBirth column . In order to do that, I set the output folder to new folder
B, so the regenerating action will not auto overwriting my current project.
Then, I want to manually
overwrite some web forms and classed which are relevant with tblOffender. I
will copy them from folder B (have
just regenerated) to folder A (current
project)
The problem with me that I don’t
know exactly what webforms (in web font-end; web admin), classes (component
layer) should I manually overwrite?
Am I right if I approach the problem this way? This
situation we will face many times when we develop new project, when the
database usually add new table, new column or drop table, drop column, change
relationship …
What should I do?
#1: It seems that
this option should not be the choice.
However, if someone likes
to discuss more with me, please read. If not, please ignore this below text.
------------------------------------------------------
I found this line in generated class (OffenderBase.generated.cs):
/*
Important:
Do not modify this file. Edit the file Offender.cs instead.
*/
However, in this
class I found a property of Country of Birth as below:
/// <summary>
/// Gets or sets the
CountryOfBirth property.
///
/// </summary>
/// <value>This type is smallint.</value>
/// <remarks>
/// This property can be set to null.
/// If this column is null, this property will return
(short)0. It is up to the developer
/// to check the value of IsCountryOfBirthNull() and perform
business logic appropriately.
/// </remarks>
[DescriptionAttribute(""),
System.ComponentModel.Bindable( System.ComponentModel.BindableSupport.Yes)]
[DataObjectField(false, false, true)]
public virtual System.Int16?
CountryOfBirth
{
get
{
return this.entityData.CountryOfBirth;
}
set
{
if (this.entityData.CountryOfBirth == value)
return;
OnColumnChanging(OffenderColumn.CountryOfBirth,
this.entityData.CountryOfBirth);
this.entityData.CountryOfBirth
= value;
if (this.EntityState == EntityState.Unchanged)
this.EntityState
= EntityState.Changed;
OnColumnChanged(OffenderColumn.CountryOfBirth,
this.entityData.CountryOfBirth);
OnPropertyChanged("CountryOfBirth");
}
}
In my current database, this column is no longer exist. How can I reflect the change in database level into component
layer as well as web font-end layer without touch in this generated class? Is there
any way to modify Offender.cs only
to reflect the change?
------------------------------------------------------