1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715
| [System.SerializableAttribute()]
[System.ComponentModel.DataObjectAttribute()]
[System.Diagnostics.DebuggerDisplayAttribute("EK={EntityKey}, Name={Name}, Id={Id}")]
[System.ComponentModel.TypeConverterAttribute(typeof(CodeFluent.Runtime.Design.NameTypeConverter))]
public partial class Customer : System.ICloneable, System.IComparable, System.IComparable<Model1.Customer>, CodeFluent.Runtime.ICodeFluentCollectionEntity<int>, System.ComponentModel.IDataErrorInfo, CodeFluent.Runtime.ICodeFluentMemberValidator, CodeFluent.Runtime.ICodeFluentSummaryValidator, System.IEquatable<Model1.Customer>
{
private bool _raisePropertyChangedEvents = true;
private CodeFluent.Runtime.CodeFluentEntityState _entityState;
private byte[] _rowVersion;
private int _id = -1;
private string _name = default(string);
[System.NonSerializedAttribute()]
private static CodeFluent.Runtime.Rules.StringValidator _nameValidator = new CodeFluent.Runtime.Rules.StringValidator(Model1.Resources.ValueValidationFailureHandler.Current, 1, 50, default(string), default(CodeFluent.Runtime.Rules.StringValidatorOptions));
public Customer()
{
this._entityState = CodeFluent.Runtime.CodeFluentEntityState.Created;
}
[System.ComponentModel.BrowsableAttribute(false)]
[System.Xml.Serialization.XmlIgnoreAttribute()]
public virtual bool RaisePropertyChangedEvents
{
get
{
return this._raisePropertyChangedEvents;
}
set
{
this._raisePropertyChangedEvents = value;
}
}
public virtual string EntityKey
{
get
{
return this.Id.ToString();
}
set
{
this.Id = ((int)(ConvertUtilities.ChangeType(value, typeof(int), -1)));
}
}
public virtual string EntityDisplayName
{
get
{
return this.Name;
}
}
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true)]
[System.ComponentModel.DataObjectFieldAttribute(false, true)]
[System.ComponentModel.TypeConverterAttribute(typeof(CodeFluent.Runtime.Design.ByteArrayConverter))]
public byte[] RowVersion
{
get
{
return this._rowVersion;
}
set
{
if (((value != null) && (value.Length == 0)))
{
value = null;
}
this._rowVersion = value;
this.OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("RowVersion"));
}
}
[System.ComponentModel.DefaultValueAttribute(((int)(-1)))]
[System.Xml.Serialization.XmlElementAttribute(IsNullable=false, Type=typeof(int))]
[System.ComponentModel.DataObjectFieldAttribute(true)]
public int Id
{
get
{
return this._id;
}
set
{
if ((System.Collections.Generic.EqualityComparer<int>.Default.Equals(value, this._id) == true))
{
return;
}
int oldKey = this._id;
this._id = value;
try
{
this.OnCollectionKeyChanged(oldKey);
}
catch (System.ArgumentException )
{
this._id = oldKey;
return;
}
this.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Modified;
this.OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("Id"));
}
}
[System.ComponentModel.DefaultValueAttribute(default(string))]
[System.Xml.Serialization.XmlElementAttribute(IsNullable=true, Type=typeof(string))]
public string Name
{
get
{
return this._name;
}
set
{
this._name = value;
this.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Modified;
this.OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("Name"));
}
}
protected static CodeFluent.Runtime.Rules.StringValidator NameValidator
{
get
{
return Model1.Customer._nameValidator;
}
}
string System.ComponentModel.IDataErrorInfo.Error
{
get
{
return this.Validate(System.Globalization.CultureInfo.CurrentCulture);
}
}
string System.ComponentModel.IDataErrorInfo.this[string columnName]
{
get
{
return CodeFluentPersistence.ValidateMember(System.Globalization.CultureInfo.CurrentCulture, this, columnName, null);
}
}
int CodeFluent.Runtime.Utilities.IKeyable<System.Int32>.Key
{
get
{
return this.Id;
}
}
public virtual CodeFluent.Runtime.CodeFluentEntityState EntityState
{
get
{
return this._entityState;
}
set
{
if ((System.Collections.Generic.EqualityComparer<CodeFluent.Runtime.CodeFluentEntityState>.Default.Equals(value, this.EntityState) == true))
{
return;
}
if (((this._entityState == CodeFluent.Runtime.CodeFluentEntityState.ToBeDeleted)
&& (value == CodeFluent.Runtime.CodeFluentEntityState.Modified)))
{
return;
}
if (((this._entityState == CodeFluent.Runtime.CodeFluentEntityState.Created)
&& (value == CodeFluent.Runtime.CodeFluentEntityState.Modified)))
{
return;
}
this._entityState = value;
this.OnPropertyChanged(new System.ComponentModel.PropertyChangedEventArgs("EntityState"));
}
}
[field:System.NonSerializedAttribute()]
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
[field:System.NonSerializedAttribute()]
public event CodeFluent.Runtime.CodeFluentEntityActionEventHandler EntityAction;
[field:System.NonSerializedAttribute()]
public event System.EventHandler<CodeFluent.Runtime.Utilities.KeyChangedEventArgs<int>> KeyChanged;
protected virtual void OnPropertyChanged(System.ComponentModel.PropertyChangedEventArgs e)
{
if ((this.RaisePropertyChangedEvents == false))
{
return;
}
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, e);
}
}
protected virtual void OnEntityAction(CodeFluent.Runtime.CodeFluentEntityActionEventArgs e)
{
if ((this.EntityAction != null))
{
this.EntityAction(this, e);
}
}
public virtual bool Equals(Model1.Customer customer)
{
if ((customer == null))
{
return false;
}
if ((this.Id == -1))
{
return base.Equals(customer);
}
return (this.Id.Equals(customer.Id) == true);
}
public override int GetHashCode()
{
return this._id;
}
public override bool Equals(object obj)
{
Model1.Customer customer = null;
customer = obj as Model1.Customer;
return this.Equals(customer);
}
int System.IComparable.CompareTo(object value)
{
Model1.Customer customer = null;
customer = value as Model1.Customer;
if ((customer == null))
{
throw new System.ArgumentException("value");
}
int localCompareTo = this.CompareTo(customer);
return localCompareTo;
}
public virtual int CompareTo(Model1.Customer customer)
{
if ((customer == null))
{
throw new System.ArgumentNullException("customer");
}
int localCompareTo = this.Id.CompareTo(customer.Id);
return localCompareTo;
}
public virtual string Validate(System.Globalization.CultureInfo culture)
{
return CodeFluentPersistence.Validate(culture, this, null);
}
public virtual void Validate(System.Globalization.CultureInfo culture, System.Collections.Generic.IList<CodeFluent.Runtime.CodeFluentValidationException> results)
{
CodeFluent.Runtime.CodeFluentEntityActionEventArgs evt = new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.Validating, true, results);
evt.Culture = culture;
this.OnEntityAction(evt);
if ((evt.Cancel == true))
{
string externalValidate;
if ((evt.Argument != null))
{
externalValidate = evt.Argument.ToString();
}
else
{
externalValidate = Model1.Resources.Manager.GetStringWithDefault(culture, "Model1.Customer.ExternalValidate", "Type \'Model1.Customer\' cannot be validated.", null);
}
CodeFluentPersistence.AddValidationError(results, externalValidate);
}
CodeFluentPersistence.ValidateMember(culture, results, this, null);
if ((this.Name == default(string)))
{
string localValidate = Model1.Resources.Manager.GetStringWithDefault(culture, "Model1.Customer.Name.NullException", "\'Name\' property cannot be set to \'\' for type \'Model1.Customer\'", null);
CodeFluentPersistence.AddValidationError(results, localValidate);
}
this.OnEntityAction(new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.Validated, false, results));
}
public void Validate()
{
string var = this.Validate(System.Globalization.CultureInfo.CurrentCulture);
if ((var != null))
{
throw new CodeFluent.Runtime.CodeFluentValidationException(var);
}
}
string CodeFluent.Runtime.ICodeFluentValidator.Validate(System.Globalization.CultureInfo culture)
{
string localValidate = this.Validate(culture);
return localValidate;
}
void CodeFluent.Runtime.ICodeFluentMemberValidator.Validate(System.Globalization.CultureInfo culture, string memberName, System.Collections.Generic.IList<CodeFluent.Runtime.CodeFluentValidationException> results)
{
this.ValidateMember(culture, memberName, results);
}
public virtual bool Delete()
{
bool ret = false;
CodeFluent.Runtime.CodeFluentEntityActionEventArgs evt = new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.Deleting, true);
this.OnEntityAction(evt);
if ((evt.Cancel == true))
{
return ret;
}
if ((this.EntityState == CodeFluent.Runtime.CodeFluentEntityState.Deleted))
{
return ret;
}
if ((this.RowVersion == null))
{
return ret;
}
CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(Model1.Constants.Model1StoreName).Persistence;
persistence.CreateStoredProcedureCommand(null, "Customer", "Delete");
persistence.AddParameter("@Customer_Id", this.Id, ((int)(-1)));
persistence.AddParameter("@_rowVersion", this.RowVersion);
persistence.ExecuteNonQuery();
this.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Deleted;
this.OnEntityAction(new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.Deleted, false, false));
ret = true;
return ret;
}
protected virtual void ReadRecord(System.Data.IDataReader reader, CodeFluent.Runtime.CodeFluentReloadOptions options)
{
if ((reader == null))
{
throw new System.ArgumentNullException("reader");
}
if ((((options & CodeFluent.Runtime.CodeFluentReloadOptions.Properties)
== 0)
== false))
{
this._id = CodeFluentPersistence.GetReaderValue(reader, "Customer_Id", ((int)(-1)));
this._name = CodeFluentPersistence.GetReaderValue(reader, "Customer_Name", ((string)(default(string))));
}
if ((((options & CodeFluent.Runtime.CodeFluentReloadOptions.RowVersion)
== 0)
== false))
{
this._rowVersion = CodeFluentPersistence.GetReaderValue(reader, "_rowVersion", ((byte[])(null)));
}
this.OnEntityAction(new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.ReadRecord, false, false));
}
void CodeFluent.Runtime.ICodeFluentEntity.ReadRecord(System.Data.IDataReader reader)
{
this.ReadRecord(reader, CodeFluent.Runtime.CodeFluentReloadOptions.Default);
}
protected virtual void ReadRecordOnSave(System.Data.IDataReader reader)
{
if ((reader == null))
{
throw new System.ArgumentNullException("reader");
}
this._id = CodeFluentPersistence.GetReaderValue(reader, "Customer_Id", ((int)(-1)));
this._rowVersion = CodeFluentPersistence.GetReaderValue(reader, "_rowVersion", ((byte[])(null)));
this.OnEntityAction(new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.ReadRecordOnSave, false, false));
}
void CodeFluent.Runtime.ICodeFluentEntity.ReadRecordOnSave(System.Data.IDataReader reader)
{
this.ReadRecordOnSave(reader);
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
public static Model1.Customer Load(int id)
{
if ((id == -1))
{
return null;
}
Model1.Customer customer = new Model1.Customer();
CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(Model1.Constants.Model1StoreName).Persistence;
persistence.CreateStoredProcedureCommand(null, "Customer", "Load");
persistence.AddParameter("@Id", id, ((int)(-1)));
System.Data.IDataReader reader = null;
try
{
reader = persistence.ExecuteReader();
if ((reader.Read() == true))
{
customer.ReadRecord(reader, CodeFluent.Runtime.CodeFluentReloadOptions.Default);
customer.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
return customer;
}
}
finally
{
if ((reader != null))
{
reader.Dispose();
}
persistence.CompleteCommand();
}
return null;
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
public static Model1.Customer LoadById(int id)
{
if ((id == -1))
{
return null;
}
Model1.Customer customer = new Model1.Customer();
CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(Model1.Constants.Model1StoreName).Persistence;
persistence.CreateStoredProcedureCommand(null, "Customer", "LoadById");
persistence.AddParameter("@Id", id, ((int)(-1)));
System.Data.IDataReader reader = null;
try
{
reader = persistence.ExecuteReader();
if ((reader.Read() == true))
{
customer.ReadRecord(reader, CodeFluent.Runtime.CodeFluentReloadOptions.Default);
customer.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
return customer;
}
}
finally
{
if ((reader != null))
{
reader.Dispose();
}
persistence.CompleteCommand();
}
return null;
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)]
public static Model1.Customer LoadByName(string name)
{
if ((name == default(string)))
{
return null;
}
Model1.Customer customer = new Model1.Customer();
CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(Model1.Constants.Model1StoreName).Persistence;
persistence.CreateStoredProcedureCommand(null, "Customer", "LoadByName");
persistence.AddParameter("@Name", name, default(string));
System.Data.IDataReader reader = null;
try
{
reader = persistence.ExecuteReader();
if ((reader.Read() == true))
{
customer.ReadRecord(reader, CodeFluent.Runtime.CodeFluentReloadOptions.Default);
customer.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
return customer;
}
}
finally
{
if ((reader != null))
{
reader.Dispose();
}
persistence.CompleteCommand();
}
return null;
}
public virtual bool Reload(CodeFluent.Runtime.CodeFluentReloadOptions options)
{
bool ret = false;
if ((this.Id == -1))
{
return ret;
}
CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(Model1.Constants.Model1StoreName).Persistence;
persistence.CreateStoredProcedureCommand(null, "Customer", "Load");
persistence.AddParameter("@Id", this.Id, ((int)(-1)));
System.Data.IDataReader reader = null;
try
{
reader = persistence.ExecuteReader();
if ((reader.Read() == true))
{
this.ReadRecord(reader, options);
this.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
ret = true;
}
else
{
this.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Deleted;
}
}
finally
{
if ((reader != null))
{
reader.Dispose();
}
persistence.CompleteCommand();
}
return ret;
}
protected virtual bool BaseSave(bool force)
{
if ((this.EntityState == CodeFluent.Runtime.CodeFluentEntityState.ToBeDeleted))
{
this.Delete();
return false;
}
CodeFluent.Runtime.CodeFluentEntityActionEventArgs evt = new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.Saving, true);
this.OnEntityAction(evt);
if ((evt.Cancel == true))
{
return false;
}
CodeFluentPersistence.ThrowIfDeleted(this);
this.Validate();
if (((force == false) && (this.EntityState == CodeFluent.Runtime.CodeFluentEntityState.Unchanged)))
{
return false;
}
CodeFluent.Runtime.CodeFluentPersistence persistence = CodeFluentContext.Get(Model1.Constants.Model1StoreName).Persistence;
persistence.CreateStoredProcedureCommand(null, "Customer", "Save");
persistence.AddParameter("@Customer_Id", this.Id, ((int)(-1)));
persistence.AddParameter("@Customer_Name", this.Name, default(string));
persistence.AddParameter("@_trackLastWriteUser", persistence.Context.User.Name);
persistence.AddParameter("@_rowVersion", this.RowVersion);
System.Data.IDataReader reader = null;
try
{
reader = persistence.ExecuteReader();
if ((reader.Read() == true))
{
this.ReadRecordOnSave(reader);
}
CodeFluentPersistence.NextResults(reader);
}
finally
{
if ((reader != null))
{
reader.Dispose();
}
persistence.CompleteCommand();
}
this.OnEntityAction(new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.Saved, false, false));
this.EntityState = CodeFluent.Runtime.CodeFluentEntityState.Unchanged;
return true;
}
public virtual bool Save()
{
bool localSave = this.BaseSave(false);
return localSave;
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)]
public static bool Save(Model1.Customer customer)
{
if ((customer == null))
{
return false;
}
bool ret = customer.Save();
return ret;
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Insert, true)]
public static bool Insert(Model1.Customer customer)
{
bool ret = Model1.Customer.Save(customer);
return ret;
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Delete, true)]
public static bool Delete(Model1.Customer customer)
{
if ((customer == null))
{
return false;
}
bool ret = customer.Delete();
return ret;
}
public string Trace()
{
System.Text.StringBuilder stringBuilder = new System.Text.StringBuilder();
System.IO.StringWriter stringWriter = new System.IO.StringWriter(stringBuilder, System.Globalization.CultureInfo.CurrentCulture);
System.CodeDom.Compiler.IndentedTextWriter writer = new System.CodeDom.Compiler.IndentedTextWriter(stringWriter);
this.BaseTrace(writer);
writer.Flush();
((System.IDisposable)(writer)).Dispose();
((System.IDisposable)(stringWriter)).Dispose();
string sr = stringBuilder.ToString();
return sr;
}
void CodeFluent.Runtime.ICodeFluentObject.Trace(System.CodeDom.Compiler.IndentedTextWriter writer)
{
this.BaseTrace(writer);
}
protected virtual void BaseTrace(System.CodeDom.Compiler.IndentedTextWriter writer)
{
writer.Write("[");
writer.Write("Id=");
writer.Write(this.Id);
writer.Write(",");
writer.Write("Name=");
writer.Write(this.Name);
writer.Write(", EntityState=");
writer.Write(this.EntityState);
writer.Write("]");
}
[System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, true)]
public static Model1.Customer LoadByEntityKey(string key)
{
if ((key == string.Empty))
{
return null;
}
Model1.Customer customer;
int var = ((int)(ConvertUtilities.ChangeType(key, typeof(int), -1)));
customer = Model1.Customer.Load(var);
return customer;
}
protected virtual void ValidateMember(System.Globalization.CultureInfo culture, string memberName, System.Collections.Generic.IList<CodeFluent.Runtime.CodeFluentValidationException> results)
{
if (((memberName == "Name") || (memberName == null)))
{
CodeFluent.Runtime.Rules.ValueValidator.Validate(this, culture, "Name", results, Model1.Customer.NameValidator0, this.Name);
}
}
public Model1.Customer Clone(bool deep)
{
Model1.Customer customer = new Model1.Customer();
this.CopyTo(customer, deep);
return customer;
}
public Model1.Customer Clone()
{
Model1.Customer localClone = this.Clone(true);
return localClone;
}
object System.ICloneable.Clone()
{
object localClone = this.Clone();
return localClone;
}
public virtual void CopyFrom(System.Collections.IDictionary dict, bool deep)
{
if ((dict == null))
{
throw new System.ArgumentNullException("dict");
}
if ((dict.Contains("Id") == true))
{
this.Id = ((int)(ConvertUtilities.ChangeType(dict["Id"], typeof(int), -1)));
}
if ((dict.Contains("Name") == true))
{
this.Name = ((string)(ConvertUtilities.ChangeType(dict["Name"], typeof(string), default(string))));
}
this.OnEntityAction(new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.CopyFrom, false, dict));
}
public virtual void CopyTo(Model1.Customer customer, bool deep)
{
if ((customer == null))
{
throw new System.ArgumentNullException("customer");
}
customer.Id = this.Id;
customer.Name = this.Name;
this.OnEntityAction(new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.CopyTo, false, customer));
}
public virtual void CopyTo(System.Collections.IDictionary dict, bool deep)
{
if ((dict == null))
{
throw new System.ArgumentNullException("dict");
}
dict["Id"] = this.Id;
dict["Name"] = this.Name;
this.OnEntityAction(new CodeFluent.Runtime.CodeFluentEntityActionEventArgs(this, CodeFluent.Runtime.CodeFluentEntityAction.CopyTo, false, dict));
}
protected void OnCollectionKeyChanged(int key)
{
if ((this.KeyChanged != null))
{
this.KeyChanged(this, new CodeFluent.Runtime.Utilities.KeyChangedEventArgs<int>(key));
}
}
} |
Partager