Necesitaba extender mis clases parciales EF, porque quiero agregar algunas funcionalidades para poder usar las secuencias de Oracle, sin embargo, realmente no sé cómo usar esta clase parcial, hecho un archivo .cs independiente y el nombre como una de mis clases generadas automáticamente de la siguiente manera:EF 4, cómo agregar clases parciales
namespace GlassStoreDAL
{
public partial class CAR
{
private int _sequences;
public int sequences
{
get { return _sequences; }
set { _sequences = value; }
}
}
}
Ahora supone que, en mi BLL - que hace referencia a GlassStoreDAL - puedo encontrar mi propiedad "secuencias", pero aparentemente algo va mal, agradecería cualquier ayuda aquí.
Aquí está mi clase parcial generada, ¿debería tener la propiedad de secuencias también allí?
[EdmEntityTypeAttribute(NamespaceName="Model", Name="CAR")]
[Serializable()]
[DataContractAttribute(IsReference=true)]
public partial class CAR : EntityObject
{
#region Factory Method
/// <summary>
/// Create a new CAR object.
/// </summary>
/// <param name="id">Initial value of the ID property.</param>
public static CAR CreateCAR(global::System.Decimal id)
{
CAR cAR = new CAR();
cAR.ID = id;
return cAR;
}
#endregion
#region Primitive Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Decimal ID
{
get
{
return _ID;
}
set
{
if (_ID != value)
{
OnIDChanging(value);
ReportPropertyChanging("ID");
_ID = StructuralObject.SetValidValue(value);
ReportPropertyChanged("ID");
OnIDChanged();
}
}
}
private global::System.Decimal _ID;
partial void OnIDChanging(global::System.Decimal value);
partial void OnIDChanged();
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String NAME
{
get
{
return _NAME;
}
set
{
OnNAMEChanging(value);
ReportPropertyChanging("NAME");
_NAME = StructuralObject.SetValidValue(value, true);
ReportPropertyChanged("NAME");
OnNAMEChanged();
}
}
private global::System.String _NAME;
partial void OnNAMEChanging(global::System.String value);
partial void OnNAMEChanged();
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=true)]
[DataMemberAttribute()]
public global::System.String MODEL
{
get
{
return _MODEL;
}
set
{
OnMODELChanging(value);
ReportPropertyChanging("MODEL");
_MODEL = StructuralObject.SetValidValue(value, true);
ReportPropertyChanged("MODEL");
OnMODELChanged();
}
}
private global::System.String _MODEL;
partial void OnMODELChanging(global::System.String value);
partial void OnMODELChanged();
#endregion
#region Navigation Properties
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[XmlIgnoreAttribute()]
[SoapIgnoreAttribute()]
[DataMemberAttribute()]
[EdmRelationshipNavigationPropertyAttribute("Model",
"SYS_C009618", "GLASS")]
public EntityCollection<GLASS> GLASSes
{
get
{
return ((IEntityWithRelationships)this).RelationshipManager.
GetRelatedCollection<GLASS>("Model.SYS_C009618", "GLASS");
}
set
{
if ((value != null))
{
((IEntityWithRelationships)this).RelationshipManager.
InitializeRelatedCollection<GLASS>("Model.SYS_C009618",
"GLASS", value);
}
}
}
#endregion
}
¿Ambos parciales están en el mismo conjunto? – forsvarir
sí, si quiere decir con el mismo ensamblado, el mismo proyecto DLL – Musaab
Ambas clases se declaran como parciales/en el mismo espacio de nombres? – forsvarir