/// <summary> /// Create a new ContactInfoCT object. /// </summary> /// <param name="address">Initial value of the Address property.</param> /// <param name="homePhone">Initial value of the HomePhone property.</param> public static ContactInfoCT CreateContactInfoCT(AddressCT address, global::System.String homePhone) { ContactInfoCT contactInfoCT = new ContactInfoCT(); contactInfoCT.Address = StructuralObject.VerifyComplexObjectIsNotNull(address, "Address"); contactInfoCT.HomePhone = homePhone; return(contactInfoCT); }
/// <summary> /// Create a new EmployeeWithCT object. /// </summary> /// <param name="employeeID">Initial value of the EmployeeID property.</param> /// <param name="contactInfo">Initial value of the ContactInfo property.</param> public static EmployeeWithCT CreateEmployeeWithCT(global::System.Int32 employeeID, ContactInfoCT contactInfo) { EmployeeWithCT employeeWithCT = new EmployeeWithCT(); employeeWithCT.EmployeeID = employeeID; employeeWithCT.ContactInfo = StructuralObject.VerifyComplexObjectIsNotNull(contactInfo, "ContactInfo"); return(employeeWithCT); }
/// <summary> /// Create a new Agent object. /// </summary> /// <param name="agentId">Initial value of the AgentId property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="address">Initial value of the Address property.</param> public static Agent CreateAgent(global::System.Int32 agentId, Name name, Address address) { Agent agent = new Agent(); agent.AgentId = agentId; agent.Name = StructuralObject.VerifyComplexObjectIsNotNull(name, "Name"); agent.Address = StructuralObject.VerifyComplexObjectIsNotNull(address, "Address"); return(agent); }
/// <summary> /// Create a new Employee object. /// </summary> /// <param name="employeeId">Initial value of the EmployeeId property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="address">Initial value of the Address property.</param> public static Employee CreateEmployee(global::System.Int32 employeeId, global::System.String name, EmployeeAddress address) { Employee employee = new Employee(); employee.EmployeeId = employeeId; employee.Name = name; employee.Address = StructuralObject.VerifyComplexObjectIsNotNull(address, "Address"); return(employee); }
/// <summary> /// Create a new CustomerBlob object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="editTimeStamp">Initial value of the EditTimeStamp property.</param> /// <param name="address">Initial value of the Address property.</param> public static CustomerBlob CreateCustomerBlob(global::System.Int32 id, global::System.Byte[] editTimeStamp, Address address) { CustomerBlob customerBlob = new CustomerBlob(); customerBlob.ID = id; customerBlob.EditTimeStamp = editTimeStamp; customerBlob.Address = StructuralObject.VerifyComplexObjectIsNotNull(address, "Address"); return(customerBlob); }
internal void AttachToParent(StructuralObject parent, string parentPropertyName) { if (this._parent != null) { throw new InvalidOperationException(Strings.ComplexObject_ComplexObjectAlreadyAttachedToParent); } this._parent = parent; this._parentPropertyName = parentPropertyName; }
/// <summary> /// Create a new Instructor object. /// </summary> /// <param name="personID">Initial value of the PersonID property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="address">Initial value of the Address property.</param> /// <param name="hireDate">Initial value of the HireDate property.</param> public static Instructor CreateInstructor(global::System.Int32 personID, Name name, Address address, global::System.DateTime hireDate) { Instructor instructor = new Instructor(); instructor.PersonID = personID; instructor.Name = StructuralObject.VerifyComplexObjectIsNotNull(name, "Name"); instructor.Address = StructuralObject.VerifyComplexObjectIsNotNull(address, "Address"); instructor.HireDate = hireDate; return(instructor); }
/// <summary> /// Removes this instance from the parent it was attached to. /// Parent may be an Entity or ComplexObject /// </summary> internal void DetachFromParent() { // We will null out _parent and _parentPropertyName anyway, so if they are already null // it is an unexpected condition, but should not cause a failure in released code Debug.Assert(_parent != null, "Attempt to detach from a null _parent"); Debug.Assert(_parentPropertyName != null, "Null _parentPropertyName on a non-null _parent"); _parent = null; _parentPropertyName = null; }
/// <summary> /// Create a new Admin object. /// </summary> /// <param name="personID">Initial value of the PersonID property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="address">Initial value of the Address property.</param> /// <param name="adminDate">Initial value of the AdminDate property.</param> public static Admin CreateAdmin(global::System.Int32 personID, Name name, Address address, global::System.DateTime adminDate) { Admin admin = new Admin(); admin.PersonID = personID; admin.Name = StructuralObject.VerifyComplexObjectIsNotNull(name, "Name"); admin.Address = StructuralObject.VerifyComplexObjectIsNotNull(address, "Address"); admin.AdminDate = adminDate; return(admin); }
/// <summary> /// Create a new CustomerWithBirthday object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="editTimeStamp">Initial value of the EditTimeStamp property.</param> /// <param name="address">Initial value of the Address property.</param> /// <param name="birthday">Initial value of the Birthday property.</param> public static CustomerWithBirthday CreateCustomerWithBirthday(global::System.Int32 id, global::System.Byte[] editTimeStamp, Address address, global::System.DateTime birthday) { CustomerWithBirthday customerWithBirthday = new CustomerWithBirthday(); customerWithBirthday.ID = id; customerWithBirthday.EditTimeStamp = editTimeStamp; customerWithBirthday.Address = StructuralObject.VerifyComplexObjectIsNotNull(address, "Address"); customerWithBirthday.Birthday = birthday; return(customerWithBirthday); }
/// <summary> /// Create a new BusinessStudent object. /// </summary> /// <param name="personID">Initial value of the PersonID property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="address">Initial value of the Address property.</param> /// <param name="enrollmentDate">Initial value of the EnrollmentDate property.</param> public static BusinessStudent CreateBusinessStudent(global::System.Int32 personID, Name name, Address address, global::System.DateTime enrollmentDate) { BusinessStudent businessStudent = new BusinessStudent(); businessStudent.PersonID = personID; businessStudent.Name = StructuralObject.VerifyComplexObjectIsNotNull(name, "Name"); businessStudent.Address = StructuralObject.VerifyComplexObjectIsNotNull(address, "Address"); businessStudent.EnrollmentDate = enrollmentDate; return(businessStudent); }
/// <summary> /// Create a new PhotoInfo object. /// </summary> /// <param name="photoId">Initial value of the PhotoId property.</param> /// <param name="fileName">Initial value of the FileName property.</param> /// <param name="dateAdded">Initial value of the DateAdded property.</param> /// <param name="exposure">Initial value of the Exposure property.</param> /// <param name="dimensions">Initial value of the Dimensions property.</param> /// <param name="dateModified">Initial value of the DateModified property.</param> public static PhotoInfo CreatePhotoInfo(global::System.Int32 photoId, global::System.String fileName, global::System.DateTime dateAdded, Exposure exposure, Dimensions dimensions, global::System.DateTime dateModified) { PhotoInfo photoInfo = new PhotoInfo(); photoInfo.PhotoId = photoId; photoInfo.FileName = fileName; photoInfo.DateAdded = dateAdded; photoInfo.Exposure = StructuralObject.VerifyComplexObjectIsNotNull(exposure, "Exposure"); photoInfo.Dimensions = StructuralObject.VerifyComplexObjectIsNotNull(dimensions, "Dimensions"); photoInfo.DateModified = dateModified; return(photoInfo); }
/// <summary> /// Create a new Person object. /// </summary> /// <param name="personID">Initial value of the PersonID property.</param> /// <param name="lastName">Initial value of the LastName property.</param> /// <param name="firstName">Initial value of the FirstName property.</param> /// <param name="personCategory">Initial value of the PersonCategory property.</param> /// <param name="personAddress">Initial value of the PersonAddress property.</param> /// <param name="personDate">Initial value of the PersonDate property.</param> public static Person CreatePerson(global::System.Int32 personID, global::System.String lastName, global::System.String firstName, global::System.Int16 personCategory, PersonAddress personAddress, PersonDate personDate) { Person person = new Person(); person.PersonID = personID; person.LastName = lastName; person.FirstName = firstName; person.PersonCategory = personCategory; person.PersonAddress = StructuralObject.VerifyComplexObjectIsNotNull(personAddress, "PersonAddress"); person.PersonDate = StructuralObject.VerifyComplexObjectIsNotNull(personDate, "PersonDate"); return(person); }
/// <summary> /// Create a new Customer object. /// </summary> /// <param name="customerId">Initial value of the CustomerId property.</param> /// <param name="firstname">Initial value of the Firstname property.</param> /// <param name="lastname">Initial value of the Lastname property.</param> /// <param name="address">Initial value of the Address property.</param> /// <param name="city">Initial value of the City property.</param> /// <param name="additionalContactInfo">Initial value of the AdditionalContactInfo property.</param> public static Customer CreateCustomer(global::System.Int32 customerId, global::System.String firstname, global::System.String lastname, global::System.String address, global::System.String city, ContactInfo additionalContactInfo) { Customer customer = new Customer(); customer.CustomerId = customerId; customer.Firstname = firstname; customer.Lastname = lastname; customer.Address = address; customer.City = city; customer.AdditionalContactInfo = StructuralObject.VerifyComplexObjectIsNotNull(additionalContactInfo, "AdditionalContactInfo"); return(customer); }
private string _parentPropertyName; // Property name for this type on the containing object /// <summary> /// Associate the ComplexType with an Entity or another ComplexObject /// Parent may be an Entity or ComplexObject /// </summary> /// <param name="parent">Object to be added to.</param> /// <param name="parentPropertyName">The property on the parent that reference the complex type.</param> internal void AttachToParent( StructuralObject parent, string parentPropertyName) { Debug.Assert(null != parent, "Attempt to attach to a null parent"); Debug.Assert(null != parentPropertyName, "Must provide parentPropertyName in order to attach"); if (_parent != null) { throw new InvalidOperationException(Strings.ComplexObject_ComplexObjectAlreadyAttachedToParent); } Debug.Assert(_parentPropertyName == null); _parent = parent; _parentPropertyName = parentPropertyName; }
private string _parentPropertyName; // Property name for this type on the containing object /// <summary> /// Associate the ComplexType with an Entity or another ComplexObject /// Parent may be an Entity or ComplexObject /// </summary> /// <param name="parent"> Object to be added to. </param> /// <param name="parentPropertyName"> The property on the parent that reference the complex type. </param> internal void AttachToParent( StructuralObject parent, string parentPropertyName) { DebugCheck.NotNull(parent); DebugCheck.NotNull(parentPropertyName); if (_parent != null) { throw new InvalidOperationException(Strings.ComplexObject_ComplexObjectAlreadyAttachedToParent); } Debug.Assert(_parentPropertyName == null); _parent = parent; _parentPropertyName = parentPropertyName; }
private string _parentPropertyName; // Property name for this type on the containing object /// <summary> /// Associate the ComplexType with an Entity or another ComplexObject /// Parent may be an Entity or ComplexObject /// </summary> /// <param name="parent">Object to be added to.</param> /// <param name="parentPropertyName">The property on the parent that reference the complex type.</param> internal void AttachToParent( StructuralObject parent, string parentPropertyName) { Debug.Assert(null != parent, "Attempt to attach to a null parent"); Debug.Assert(null != parentPropertyName, "Must provide parentPropertyName in order to attach"); if (_parent != null) { throw EntityUtil.ComplexObjectAlreadyAttachedToParent(); } Debug.Assert(_parentPropertyName == null); _parent = parent; _parentPropertyName = parentPropertyName; }
private string _parentPropertyName; // Property name for this type on the containing object // <summary> // Associate the ComplexType with an Entity or another ComplexObject // Parent may be an Entity or ComplexObject // </summary> // <param name="parent"> Object to be added to. </param> // <param name="parentPropertyName"> The property on the parent that reference the complex type. </param> internal void AttachToParent( StructuralObject parent, string parentPropertyName) { DebugCheck.NotNull(parent); DebugCheck.NotNull(parentPropertyName); if (_parent != null) { throw new InvalidOperationException(Strings.ComplexObject_ComplexObjectAlreadyAttachedToParent); } Debug.Assert(_parentPropertyName == null); _parent = parent; _parentPropertyName = parentPropertyName; }
internal void DetachFromParent() { this._parent = (StructuralObject)null; this._parentPropertyName = (string)null; }