¿Possible error?

¿Possible error?

Postby degas » Fri 03 Apr 2009 21:21

I have been using LinqToOracle. My eviorement is:
Oracle 10g
VS 2008
Net Framework 3.5 SP1.

I have tried the following code:

DegMailDataContext dataContext = new DegMailDataContext();
Mail mail = new Mail
{
FromMail = FromTextEdit.Text,
Subject = SubjectTextEdit.Text,
IsHtml = "N",
Body = BodyMemoEdit.Text,
DateTime = DateTime.Now,
Direct = "S",
};

dataContext.Mails.InsertOnSubmit(mail);

char[] splitter = { ',', ';' };
MailTo mailTo;
foreach (string MailReceptor in ToTextEdit.Text.Split(splitter))
{
mailTo = new MailTo(){
Enviado = "N",
ToMail = MailReceptor
};

bool mailAddressNoExiste = true;

foreach (MailTo to in mail.MailTos)
{
if (to.ToMail.ToUpper() == MailReceptor.ToUpper()) {
mailAddressNoExiste = false;
}
}

if (mailAddressNoExiste)
{
try
{
mail.MailTos.Add(mailTo);

}
catch (Exception ex)
{
mail.MailTos.Remove(mailTo);
}
}

}

dataContext.SubmitChanges();
dataContext.Connection.Close();
dataContext.Dispose();


and works fine, but when i tried this it fails to work correctly:

DegMailDataContext dataContext = new DegMailDataContext();
Mail mail = new Mail
{
FromMail = FromTextEdit.Text,
Subject = SubjectTextEdit.Text,
IsHtml = "N",
Body = BodyMemoEdit.Text,
DateTime = DateTime.Now,
Direct = "S",
};

dataContext.Mails.InsertOnSubmit(mail);

char[] splitter = { ',', ';' };
MailTo mailTo;
foreach (string MailReceptor in ToTextEdit.Text.Split(splitter))
{
mailTo = new MailTo(){
Enviado = "N",
ToMail = MailReceptor
};

bool mailAddressNoExiste = true;

foreach (MailTo to in mail.MailTos)
{
if (to.ToMail.ToUpper() == MailReceptor.ToUpper()) {
mailAddressNoExiste = false;

}
}

if (mailAddressNoExiste)
{
try
{
mail.MailTos.Add(mailTo);
dataContext.SubmitChanges(); <----HERE

}
catch (Exception ex)
{
mail.MailTos.Remove(mailTo);
}
}

}


dataContext.SubmitChanges();
dataContext.Connection.Close();
dataContext.Dispose();

This throws an exception:

Value of member 'IdMailTo' of an object of type 'MailTo' changed.A member that is computed or generated by the database cannot be changed.


Here is the data context:


//------------------------------------------------------------------------------
// This is auto-generated code.
//------------------------------------------------------------------------------
// This code was generated by Devart Entity Developer tool.
// Code is generated on: 03/04/2009 06:09:03 p.m.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
//------------------------------------------------------------------------------
namespace SziCom.DegMail.Data
{
using System.Data.Linq;
using System.Data.Linq.Mapping;
using System.Data;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;
using System.Linq.Expressions;
using System.ComponentModel;
using System;

[System.Data.Linq.Mapping.DatabaseAttribute(Name = "SISTEMA")]
[ProviderAttribute(typeof(Devart.Data.Oracle.Linq.Provider.OracleDataProvider))]
public partial class DegMailDataContext : Devart.Data.Linq.DataContext
{
private static System.Data.Linq.Mapping.MappingSource mappingSource = new Devart.Data.Linq.Mapping.AttributeMappingSource();

#region Extensibility Method Definitions
partial void OnCreated();
partial void InsertMail(Mail instance);
partial void UpdateMail(Mail instance);
partial void DeleteMail(Mail instance);
partial void InsertMailAttachment(MailAttachment instance);
partial void UpdateMailAttachment(MailAttachment instance);
partial void DeleteMailAttachment(MailAttachment instance);
partial void InsertMailLog(MailLog instance);
partial void UpdateMailLog(MailLog instance);
partial void DeleteMailLog(MailLog instance);
partial void InsertMailTo(MailTo instance);
partial void UpdateMailTo(MailTo instance);
partial void DeleteMailTo(MailTo instance);
#endregion



public DegMailDataContext(string connection) :
base(connection, mappingSource)
{
OnCreated();
}

public DegMailDataContext(System.Data.IDbConnection connection) :
base(connection, mappingSource)
{
OnCreated();
}

public DegMailDataContext(string connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}

public DegMailDataContext(System.Data.IDbConnection connection, System.Data.Linq.Mapping.MappingSource mappingSource) :
base(connection, mappingSource)
{
OnCreated();
}

public Devart.Data.Linq.Table Mails
{
get
{
return this.GetTable();
}
}

public Devart.Data.Linq.Table MailAttachments
{
get
{
return this.GetTable();
}
}

public Devart.Data.Linq.Table MailLogs
{
get
{
return this.GetTable();
}
}

public Devart.Data.Linq.Table MailTos
{
get
{
return this.GetTable();
}
}
}

[Table(Name = @"SISTEMA.MAIL")]
public partial class Mail : INotifyPropertyChanging, INotifyPropertyChanged
{

private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

private System.Int32 _IdMail;

private System.String _FromMail;

private System.String _FromDisplayName;

private System.Nullable _DateTime;

private System.String _Body;

private System.String _IsHtml;

private System.String _Subject;

private System.String _Direct;

private EntitySet _MailAttachments;

private EntitySet _MailTos;

#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnIdMailChanging(System.Int32 value);
partial void OnIdMailChanged();
partial void OnFromMailChanging(System.String value);
partial void OnFromMailChanged();
partial void OnFromDisplayNameChanging(System.String value);
partial void OnFromDisplayNameChanged();
partial void OnDateTimeChanging(System.Nullable value);
partial void OnDateTimeChanged();
partial void OnBodyChanging(System.String value);
partial void OnBodyChanged();
partial void OnIsHtmlChanging(System.String value);
partial void OnIsHtmlChanged();
partial void OnSubjectChanging(System.String value);
partial void OnSubjectChanged();
partial void OnDirectChanging(System.String value);
partial void OnDirectChanged();
#endregion

public Mail()
{
this._MailAttachments = new EntitySet(new Action(this.attach_MailAttachments), new Action(this.detach_MailAttachments));
this._MailTos = new EntitySet(new Action(this.attach_MailTos), new Action(this.detach_MailTos));
OnCreated();
}

[Column(Name = @"ID_MAIL", Storage = "_IdMail", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "NUMBER(5) NOT NULL", IsDbGenerated = true, IsPrimaryKey = true)]
public System.Int32 IdMail
{
get
{
return this._IdMail;
}
set
{
if (this._IdMail != value)
{
this.OnIdMailChanging(value);
this.SendPropertyChanging();
this._IdMail = value;
this.SendPropertyChanged("IdMail");
this.OnIdMailChanged();
}
}
}

[Column(Name = @"FROM_MAIL", Storage = "_FromMail", DbType = "VARCHAR2(50)")]
public System.String FromMail
{
get
{
return this._FromMail;
}
set
{
if (this._FromMail != value)
{
this.OnFromMailChanging(value);
this.SendPropertyChanging();
this._FromMail = value;
this.SendPropertyChanged("FromMail");
this.OnFromMailChanged();
}
}
}

[Column(Name = @"FROM_DISPLAY_NAME", Storage = "_FromDisplayName", DbType = "VARCHAR2(70)")]
public System.String FromDisplayName
{
get
{
return this._FromDisplayName;
}
set
{
if (this._FromDisplayName != value)
{
this.OnFromDisplayNameChanging(value);
this.SendPropertyChanging();
this._FromDisplayName = value;
this.SendPropertyChanged("FromDisplayName");
this.OnFromDisplayNameChanged();
}
}
}

[Column(Name = @"DATE_TIME", Storage = "_DateTime", DbType = "DATE")]
public System.Nullable DateTime
{
get
{
return this._DateTime;
}
set
{
if (this._DateTime != value)
{
this.OnDateTimeChanging(value);
this.SendPropertyChanging();
this._DateTime = value;
this.SendPropertyChanged("DateTime");
this.OnDateTimeChanged();
}
}
}

[Column(Name = @"BODY", Storage = "_Body", DbType = "CLOB")]
public System.String Body
{
get
{
return this._Body;
}
set
{
if (this._Body != value)
{
this.OnBodyChanging(value);
this.SendPropertyChanging();
this._Body = value;
this.SendPropertyChanged("Body");
this.OnBodyChanged();
}
}
}

[Column(Name = @"IS_HTML", Storage = "_IsHtml", DbType = "CHAR(1)")]
public System.String IsHtml
{
get
{
return this._IsHtml;
}
set
{
if (this._IsHtml != value)
{
this.OnIsHtmlChanging(value);
this.SendPropertyChanging();
this._IsHtml = value;
this.SendPropertyChanged("IsHtml");
this.OnIsHtmlChanged();
}
}
}

[Column(Name = @"SUBJECT", Storage = "_Subject", DbType = "VARCHAR2(100)")]
public System.String Subject
{
get
{
return this._Subject;
}
set
{
if (this._Subject != value)
{
this.OnSubjectChanging(value);
this.SendPropertyChanging();
this._Subject = value;
this.SendPropertyChanged("Subject");
this.OnSubjectChanged();
}
}
}

[Column(Name = @"DIRECT", Storage = "_Direct", DbType = "CHAR(1)")]
public System.String Direct
{
get
{
return this._Direct;
}
set
{
if (this._Direct != value)
{
this.OnDirectChanging(value);
this.SendPropertyChanging();
this._Direct = value;
this.SendPropertyChanged("Direct");
this.OnDirectChanged();
}
}
}

[Association(Name="Mail_MailAttachment", Storage="_MailAttachments", OtherKey="IdMail")]
public EntitySet MailAttachments
{
get
{

return this._MailAttachments;
}
set
{
this._MailAttachments.Assign(value);
}
}

[Association(Name="Mail_MailTo", Storage="_MailTos", OtherKey="IdMail")]
public EntitySet MailTos
{
get
{

return this._MailTos;
}
set
{
this._MailTos.Assign(value);
}
}

public event PropertyChangingEventHandler PropertyChanging;

public event PropertyChangedEventHandler PropertyChanged;

protected virtual void SendPropertyChanging()
{
if (this.PropertyChanging != null)
this.PropertyChanging(this, emptyChangingEventArgs);
}

protected virtual void SendPropertyChanged(String propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}

private void attach_MailAttachments(MailAttachment entity)
{
this.SendPropertyChanging();
entity.Mail = this;
}

private void detach_MailAttachments(MailAttachment entity)
{
this.SendPropertyChanging();
entity.Mail = null;
}

private void attach_MailTos(MailTo entity)
{
this.SendPropertyChanging();
entity.Mail = this;
}

private void detach_MailTos(MailTo entity)
{
this.SendPropertyChanging();
entity.Mail = null;
}
}

[Table(Name = @"SISTEMA.MAIL_ATTACHMENTS")]
public partial class MailAttachment : INotifyPropertyChanging, INotifyPropertyChanged
{

private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

private System.Int32 _IdMailAttachment;

private System.String _FileName;

private System.String _ContentType;

private System.Nullable _Length;

private System.Byte[] _Archivo;

private System.Nullable _IdMail;

private EntityRef _Mail;

#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnIdMailAttachmentChanging(System.Int32 value);
partial void OnIdMailAttachmentChanged();
partial void OnFileNameChanging(System.String value);
partial void OnFileNameChanged();
partial void OnContentTypeChanging(System.String value);
partial void OnContentTypeChanged();
partial void OnLengthChanging(System.Nullable value);
partial void OnLengthChanged();
partial void OnArchivoChanging(System.Byte[] value);
partial void OnArchivoChanged();
partial void OnIdMailChanging(System.Nullable value);
partial void OnIdMailChanged();
#endregion

public MailAttachment()
{
this._Mail = default(EntityRef);
OnCreated();
}

[Column(Name = @"ID_MAIL_ATTACHMENT", Storage = "_IdMailAttachment", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "NUMBER(5) NOT NULL", IsDbGenerated = true, IsPrimaryKey = true)]
public System.Int32 IdMailAttachment
{
get
{
return this._IdMailAttachment;
}
set
{
if (this._IdMailAttachment != value)
{
this.OnIdMailAttachmentChanging(value);
this.SendPropertyChanging();
this._IdMailAttachment = value;
this.SendPropertyChanged("IdMailAttachment");
this.OnIdMailAttachmentChanged();
}
}
}

[Column(Name = @"FILE_NAME", Storage = "_FileName", DbType = "VARCHAR2(150)")]
public System.String FileName
{
get
{
return this._FileName;
}
set
{
if (this._FileName != value)
{
this.OnFileNameChanging(value);
this.SendPropertyChanging();
this._FileName = value;
this.SendPropertyChanged("FileName");
this.OnFileNameChanged();
}
}
}

[Column(Name = @"CONTENT_TYPE", Storage = "_ContentType", DbType = "VARCHAR2(30)")]
public System.String ContentType
{
get
{
return this._ContentType;
}
set
{
if (this._ContentType != value)
{
this.OnContentTypeChanging(value);
this.SendPropertyChanging();
this._ContentType = value;
this.SendPropertyChanged("ContentType");
this.OnContentTypeChanged();
}
}
}

[Column(Name = @"LENGTH", Storage = "_Length", DbType = "NUMBER(8)")]
public System.Nullable Length
{
get
{
return this._Length;
}
set
{
if (this._Length != value)
{
this.OnLengthChanging(value);
this.SendPropertyChanging();
this._Length = value;
this.SendPropertyChanged("Length");
this.OnLengthChanged();
}
}
}

[Column(Name = @"ARCHIVO", Storage = "_Archivo", DbType = "BLOB")]
public System.Byte[] Archivo
{
get
{
return this._Archivo;
}
set
{
if (this._Archivo != value)
{
this.OnArchivoChanging(value);
this.SendPropertyChanging();
this._Archivo = value;
this.SendPropertyChanged("Archivo");
this.OnArchivoChanged();
}
}
}

[Column(Name = @"ID_MAIL", Storage = "_IdMail", DbType = "NUMBER(5)")]
public System.Nullable IdMail
{
get
{
return this._IdMail;
}
set
{
if (this._IdMail != value)
{
if (this._Mail.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnIdMailChanging(value);
this.SendPropertyChanging();
this._IdMail = value;
this.SendPropertyChanged("IdMail");
this.OnIdMailChanged();
}
}
}

[Association(Name="Mail_MailAttachment", Storage="_Mail", ThisKey="IdMail", IsForeignKey=true)]
public Mail Mail
{
get
{
return this._Mail.Entity;
}
set
{
Mail previousValue = this._Mail.Entity;
if (((previousValue != value)
|| (this._Mail.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Mail.Entity = null;
previousValue.MailAttachments.Remove(this);
}
this._Mail.Entity = value;
if ((value != null))
{
value.MailAttachments.Add(this);
this._IdMail = value.IdMail;
}
else
{
this._IdMail = default(System.Nullable);
}
this.SendPropertyChanged("Mail");
}
}
}

public event PropertyChangingEventHandler PropertyChanging;

public event PropertyChangedEventHandler PropertyChanged;

protected virtual void SendPropertyChanging()
{
if (this.PropertyChanging != null)
this.PropertyChanging(this, emptyChangingEventArgs);
}

protected virtual void SendPropertyChanged(String propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}

[Table(Name = @"SISTEMA.MAIL_LOG")]
public partial class MailLog : INotifyPropertyChanging, INotifyPropertyChanged
{

private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

private System.Int32 _IdMailLog;

private System.Nullable _FechaHora;

private System.Nullable _IdMailTo;

private System.Byte[] _LogSmtp;

private System.String _Enviado;

private System.Nullable _ErrorCode;

private System.String _ErrorMessage;

private System.String _ServerMessage;

private EntityRef _MailTo;

#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnIdMailLogChanging(System.Int32 value);
partial void OnIdMailLogChanged();
partial void OnFechaHoraChanging(System.Nullable value);
partial void OnFechaHoraChanged();
partial void OnIdMailToChanging(System.Nullable value);
partial void OnIdMailToChanged();
partial void OnLogSmtpChanging(System.Byte[] value);
partial void OnLogSmtpChanged();
partial void OnEnviadoChanging(System.String value);
partial void OnEnviadoChanged();
partial void OnErrorCodeChanging(System.Nullable value);
partial void OnErrorCodeChanged();
partial void OnErrorMessageChanging(System.String value);
partial void OnErrorMessageChanged();
partial void OnServerMessageChanging(System.String value);
partial void OnServerMessageChanged();
#endregion

public MailLog()
{
this._MailTo = default(EntityRef);
OnCreated();
}

[Column(Name = @"ID_MAIL_LOG", Storage = "_IdMailLog", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "NUMBER(5) NOT NULL", IsDbGenerated = true, IsPrimaryKey = true)]
public System.Int32 IdMailLog
{
get
{
return this._IdMailLog;
}
set
{
if (this._IdMailLog != value)
{
this.OnIdMailLogChanging(value);
this.SendPropertyChanging();
this._IdMailLog = value;
this.SendPropertyChanged("IdMailLog");
this.OnIdMailLogChanged();
}
}
}

[Column(Name = @"FECHA_HORA", Storage = "_FechaHora", DbType = "DATE")]
public System.Nullable FechaHora
{
get
{
return this._FechaHora;
}
set
{
if (this._FechaHora != value)
{
this.OnFechaHoraChanging(value);
this.SendPropertyChanging();
this._FechaHora = value;
this.SendPropertyChanged("FechaHora");
this.OnFechaHoraChanged();
}
}
}

[Column(Name = @"ID_MAIL_TO", Storage = "_IdMailTo", DbType = "NUMBER(5)")]
public System.Nullable IdMailTo
{
get
{
return this._IdMailTo;
}
set
{
if (this._IdMailTo != value)
{
if (this._MailTo.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnIdMailToChanging(value);
this.SendPropertyChanging();
this._IdMailTo = value;
this.SendPropertyChanged("IdMailTo");
this.OnIdMailToChanged();
}
}
}

[Column(Name = @"LOG_SMTP", Storage = "_LogSmtp", DbType = "BLOB")]
public System.Byte[] LogSmtp
{
get
{
return this._LogSmtp;
}
set
{
if (this._LogSmtp != value)
{
this.OnLogSmtpChanging(value);
this.SendPropertyChanging();
this._LogSmtp = value;
this.SendPropertyChanged("LogSmtp");
this.OnLogSmtpChanged();
}
}
}

[Column(Name = @"ENVIADO", Storage = "_Enviado", DbType = "CHAR(1)")]
public System.String Enviado
{
get
{
return this._Enviado;
}
set
{
if (this._Enviado != value)
{
this.OnEnviadoChanging(value);
this.SendPropertyChanging();
this._Enviado = value;
this.SendPropertyChanged("Enviado");
this.OnEnviadoChanged();
}
}
}

[Column(Name = @"ERROR_CODE", Storage = "_ErrorCode", DbType = "NUMBER(3)")]
public System.Nullable ErrorCode
{
get
{
return this._ErrorCode;
}
set
{
if (this._ErrorCode != value)
{
this.OnErrorCodeChanging(value);
this.SendPropertyChanging();
this._ErrorCode = value;
this.SendPropertyChanged("ErrorCode");
this.OnErrorCodeChanged();
}
}
}

[Column(Name = @"ERROR_MESSAGE", Storage = "_ErrorMessage", DbType = "VARCHAR2(4000)")]
public System.String ErrorMessage
{
get
{
return this._ErrorMessage;
}
set
{
if (this._ErrorMessage != value)
{
this.OnErrorMessageChanging(value);
this.SendPropertyChanging();
this._ErrorMessage = value;
this.SendPropertyChanged("ErrorMessage");
this.OnErrorMessageChanged();
}
}
}

[Column(Name = @"SERVER_MESSAGE", Storage = "_ServerMessage", DbType = "VARCHAR2(1000)")]
public System.String ServerMessage
{
get
{
return this._ServerMessage;
}
set
{
if (this._ServerMessage != value)
{
this.OnServerMessageChanging(value);
this.SendPropertyChanging();
this._ServerMessage = value;
this.SendPropertyChanged("ServerMessage");
this.OnServerMessageChanged();
}
}
}

[Association(Name="MailTo_MailLog", Storage="_MailTo", ThisKey="IdMailTo", IsForeignKey=true)]
public MailTo MailTo
{
get
{
return this._MailTo.Entity;
}
set
{
MailTo previousValue = this._MailTo.Entity;
if (((previousValue != value)
|| (this._MailTo.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._MailTo.Entity = null;
previousValue.MailLogs.Remove(this);
}
this._MailTo.Entity = value;
if ((value != null))
{
value.MailLogs.Add(this);
this._IdMailTo = value.IdMailTo;
}
else
{
this._IdMailTo = default(System.Nullable);
}
this.SendPropertyChanged("MailTo");
}
}
}

public event PropertyChangingEventHandler PropertyChanging;

public event PropertyChangedEventHandler PropertyChanged;

protected virtual void SendPropertyChanging()
{
if (this.PropertyChanging != null)
this.PropertyChanging(this, emptyChangingEventArgs);
}

protected virtual void SendPropertyChanged(String propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}

[Table(Name = @"SISTEMA.MAIL_TO")]
public partial class MailTo : INotifyPropertyChanging, INotifyPropertyChanged
{

private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);

private System.String _ToMail;

private System.String _ToDisplayName;

private System.Int32 _IdMail;

private System.Int32 _IdMailTo;

private System.String _Enviado;

private System.String _Reintentar;

private System.Nullable _IdContacto;

private EntitySet _MailLogs;

private EntityRef _Mail;

#region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnToMailChanging(System.String value);
partial void OnToMailChanged();
partial void OnToDisplayNameChanging(System.String value);
partial void OnToDisplayNameChanged();
partial void OnIdMailChanging(System.Int32 value);
partial void OnIdMailChanged();
partial void OnIdMailToChanging(System.Int32 value);
partial void OnIdMailToChanged();
partial void OnEnviadoChanging(System.String value);
partial void OnEnviadoChanged();
partial void OnReintentarChanging(System.String value);
partial void OnReintentarChanged();
partial void OnIdContactoChanging(System.Nullable value);
partial void OnIdContactoChanged();
#endregion

public MailTo()
{
this._MailLogs = new EntitySet(new Action(this.attach_MailLogs), new Action(this.detach_MailLogs));
this._Mail = default(EntityRef);
OnCreated();
}

[Column(Name = @"TO_MAIL", Storage = "_ToMail", CanBeNull = false, DbType = "VARCHAR2(100)")]
public System.String ToMail
{
get
{
return this._ToMail;
}
set
{
if (this._ToMail != value)
{
this.OnToMailChanging(value);
this.SendPropertyChanging();
this._ToMail = value;
this.SendPropertyChanged("ToMail");
this.OnToMailChanged();
}
}
}

[Column(Name = @"TO_DISPLAY_NAME", Storage = "_ToDisplayName", DbType = "VARCHAR2(150)")]
public System.String ToDisplayName
{
get
{
return this._ToDisplayName;
}
set
{
if (this._ToDisplayName != value)
{
this.OnToDisplayNameChanging(value);
this.SendPropertyChanging();
this._ToDisplayName = value;
this.SendPropertyChanged("ToDisplayName");
this.OnToDisplayNameChanged();
}
}
}

[Column(Name = @"ID_MAIL", Storage = "_IdMail", CanBeNull = false, DbType = "NUMBER(5)")]
public System.Int32 IdMail
{
get
{
return this._IdMail;
}
set
{
if (this._IdMail != value)
{
if (this._Mail.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnIdMailChanging(value);
this.SendPropertyChanging();
this._IdMail = value;
this.SendPropertyChanged("IdMail");
this.OnIdMailChanged();
}
}
}

[Column(Name = @"ID_MAIL_TO", Storage = "_IdMailTo", AutoSync = AutoSync.OnInsert, CanBeNull = false, DbType = "NUMBER(5) NOT NULL", IsDbGenerated = true, IsPrimaryKey = true)]
public System.Int32 IdMailTo
{
get
{
return this._IdMailTo;
}
set
{
if (this._IdMailTo != value)
{
this.OnIdMailToChanging(value);
this.SendPropertyChanging();
this._IdMailTo = value;
this.SendPropertyChanged("IdMailTo");
this.OnIdMailToChanged();
}
}
}

[Column(Name = @"ENVIADO", Storage = "_Enviado", CanBeNull = false, DbType = "CHAR(1)")]
public System.String Enviado
{
get
{
return this._Enviado;
}
set
{
if (this._Enviado != value)
{
this.OnEnviadoChanging(value);
this.SendPropertyChanging();
this._Enviado = value;
this.SendPropertyChanged("Enviado");
this.OnEnviadoChanged();
}
}
}

[Column(Name = @"REINTENTAR", Storage = "_Reintentar", DbType = "CHAR(1)")]
public System.String Reintentar
{
get
{
return this._Reintentar;
}
set
{
if (this._Reintentar != value)
{
this.OnReintentarChanging(value);
this.SendPropertyChanging();
this._Reintentar = value;
this.SendPropertyChanged("Reintentar");
this.OnReintentarChanged();
}
}
}

[Column(Name = @"ID_CONTACTO", Storage = "_IdContacto", DbType = "NUMBER(4)")]
public System.Nullable IdContacto
{
get
{
return this._IdContacto;
}
set
{
if (this._IdContacto != value)
{
this.OnIdContactoChanging(value);
this.SendPropertyChanging();
this._IdContacto = value;
this.SendPropertyChanged("IdContacto");
this.OnIdContactoChanged();
}
}
}

[Association(Name="MailTo_MailLog", Storage="_MailLogs", OtherKey="IdMailTo")]
public EntitySet MailLogs
{
get
{

return this._MailLogs;
}
set
{
this._MailLogs.Assign(value);
}
}

[Association(Name="Mail_MailTo", Storage="_Mail", ThisKey="IdMail", IsForeignKey=true)]
public Mail Mail
{
get
{
return this._Mail.Entity;
}
set
{
Mail previousValue = this._Mail.Entity;
if (((previousValue != value)
|| (this._Mail.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Mail.Entity = null;
previousValue.MailTos.Remove(this);
}
this._Mail.Entity = value;
if ((value != null))
{
value.MailTos.Add(this);
this._IdMail = value.IdMail;
}
else
{
this._IdMail = default(System.Int32);
}
this.SendPropertyChanged("Mail");
}
}
}

public event PropertyChangingEventHandler PropertyChanging;

public event PropertyChangedEventHandler PropertyChanged;

protected virtual void SendPropertyChanging()
{
if (this.PropertyChanging != null)
this.PropertyChanging(this, emptyChangingEventArgs);
}

protected virtual void SendPropertyChanged(String propertyName)
{
if (this.PropertyChanged != null)
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}

private void attach_MailLogs(MailLog entity)
{
this.SendPropertyChanging();
entity.MailTo = this;
}

private void detach_MailLogs(MailLog entity)
{
this.SendPropertyChanging();
entity.MailTo = null;
}
}
}
degas
 
Posts: 77
Joined: Mon 16 Feb 2009 18:36
Location: Argentina

Postby AndreyR » Mon 06 Apr 2009 12:16

This problem was fixed in dotConnect 5.20.24 Beta.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to LinqConnect (LINQ to SQL support)