/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "Currency": this.Currency = (CurrencyEntity)entity; break; case "Currency_": this.Currency_ = (CurrencyEntity)entity; break; case "SalesOrderHeaders": this.SalesOrderHeaders.Add((SalesOrderHeaderEntity)entity); break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "AspnetApplication": this.AspnetApplication = (AspnetApplicationsEntity)entity; break; case "Language": this.Language = (LanguageEntity)entity; break; case "SnGroups": this.SnGroups.Add((SnGroupEntity)entity); break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "Address": this.Address = (AddressEntity)entity; break; case "AddressType": this.AddressType = (AddressTypeEntity)entity; break; case "BusinessEntity": this.BusinessEntity = (BusinessEntityEntity)entity; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "Products": this.Products.Add((ProductEntity)entity); break; case "ProductModelIllustrations": this.ProductModelIllustrations.Add((ProductModelIllustrationEntity)entity); break; case "ProductModelProductDescriptionCultures": this.ProductModelProductDescriptionCultures.Add((ProductModelProductDescriptionCultureEntity)entity); break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "SalesPerson": this.SalesPerson = (SalesPersonEntity)entity; break; case "Customers": this.Customers.Add((CustomerEntity)entity); break; case "BusinessEntity": this.BusinessEntity = (BusinessEntityEntity)entity; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "Product": this.Product = (ProductEntity)entity; break; case "Product_": this.Product_ = (ProductEntity)entity; break; case "UnitMeasure": this.UnitMeasure = (UnitMeasureEntity)entity; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "CountryRegionCurrencies": this.CountryRegionCurrencies.Add((CountryRegionCurrencyEntity)entity); break; case "SalesTerritories": this.SalesTerritories.Add((SalesTerritoryEntity)entity); break; case "StateProvinces": this.StateProvinces.Add((StateProvinceEntity)entity); break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "CountryRegionCurrencies": this.CountryRegionCurrencies.Add((CountryRegionCurrencyEntity)entity); break; case "CurrencyRates": this.CurrencyRates.Add((CurrencyRateEntity)entity); break; case "CurrencyRates_": this.CurrencyRates_.Add((CurrencyRateEntity)entity); break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "List": this.List = (ListEntity)entity; break; case "ListItemLocalizations": this.ListItemLocalizations.Add((ListItemLocalizationEntity)entity); break; case "SnRelationships": this.SnRelationships.Add((SnRelationshipEntity)entity); break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary> /// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> /// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param> protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne) { switch (fieldName) { case "ArtiklCollection": this.PerformRelatedEntityRemoval(this.ArtiklCollection, relatedEntity, signalRelatedEntityManyToOne); break; case "BrojacCollection": this.PerformRelatedEntityRemoval(this.BrojacCollection, relatedEntity, signalRelatedEntityManyToOne); break; case "ConfigCollection": this.PerformRelatedEntityRemoval(this.ConfigCollection, relatedEntity, signalRelatedEntityManyToOne); break; case "PartnerCollection": this.PerformRelatedEntityRemoval(this.PartnerCollection, relatedEntity, signalRelatedEntityManyToOne); break; case "PdvCollection": this.PerformRelatedEntityRemoval(this.PdvCollection, relatedEntity, signalRelatedEntityManyToOne); break; case "RacunGlavaCollection": this.PerformRelatedEntityRemoval(this.RacunGlavaCollection, relatedEntity, signalRelatedEntityManyToOne); break; case "TarifaCollection": this.PerformRelatedEntityRemoval(this.TarifaCollection, relatedEntity, signalRelatedEntityManyToOne); break; case "UserCollection": this.PerformRelatedEntityRemoval(this.UserCollection, relatedEntity, signalRelatedEntityManyToOne); break; default: break; } }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch (fieldName) { case "ArtiklCollection": this.ArtiklCollection.Add((ArtiklEntity)relatedEntity); break; case "BrojacCollection": this.BrojacCollection.Add((BrojacEntity)relatedEntity); break; case "ConfigCollection": this.ConfigCollection.Add((ConfigEntity)relatedEntity); break; case "PartnerCollection": this.PartnerCollection.Add((PartnerEntity)relatedEntity); break; case "PdvCollection": this.PdvCollection.Add((PdvEntity)relatedEntity); break; case "RacunGlavaCollection": this.RacunGlavaCollection.Add((RacunGlavaEntity)relatedEntity); break; case "TarifaCollection": this.TarifaCollection.Add((TarifaEntity)relatedEntity); break; case "UserCollection": this.UserCollection.Add((UserEntity)relatedEntity); break; default: break; } }
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "Location": _alreadyFetchedLocation = true; this.Location = (LocationEntity)entity; break; case "Treatments": _alreadyFetchedTreatments = true; if (entity != null) { this.Treatments.Add((TreatmentEntity)entity); } break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "Region": _alreadyFetchedRegion = true; this.Region = (RegionEntity)entity; break; case "EmployeeTerritories": _alreadyFetchedEmployeeTerritories = true; if (entity != null) { this.EmployeeTerritories.Add((EmployeeTerritoryEntity)entity); } break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
public override void AuditDeleteOfEntity(IEntityCore entity) { foreach (IEntityField fieldid in ((IEntity)entity).Fields) { AuditEntity auditInfo = new AuditEntity(); auditInfo.AuditorToUse = null; auditInfo.Table = fieldid.SourceObjectName; auditInfo.Field = fieldid.Name; // save old and new data var currentValue = entity.GetCurrentFieldValue(fieldid.FieldIndex); auditInfo.OldData = currentValue != null ? currentValue.ToString().Substring(0, Math.Min(currentValue.ToString().Length, AuditFields.OldData.MaxLength)) : null; // get the primary keys fields var prop = entity.GetType().GetProperty("Fields"); var fields = ((IEntityFields)prop.GetValue(entity, null)).Where(x => x.IsPrimaryKey); string key = ""; foreach (EntityField field in fields) { key += (key != "" ? "," : "") + field.CurrentValue; } auditInfo.Key = key; // save currently logged in user if (System.Web.HttpContext.Current != null && System.Web.HttpContext.Current.User != null) auditInfo.CreatedBy = System.Web.HttpContext.Current.User.Identity.Name.ToLower(); else auditInfo.CreatedBy = ""; auditInfo.CreatedDate = DateTime.UtcNow; _auditInfoEntities.Add(auditInfo); } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch (propertyName) { case "Collection": this.Collection = (CollectionEntity)entity; break; case "ActorIncidents": this.ActorIncidents.Add((ActorIncidentEntity)entity); break; case "IncidentCollectionViaActorIncident": this.IncidentCollectionViaActorIncident.IsReadOnly = false; this.IncidentCollectionViaActorIncident.Add((IncidentEntity)entity); this.IncidentCollectionViaActorIncident.IsReadOnly = true; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> /// Audits when an entity field is set succesfully to a new value. /// </summary> /// <param name="entity">The entity a field was set to a new value.</param> /// <param name="fieldIndex">Index of the field which got a new value.</param> /// <param name="originalValue">The original value of the field with the index passed in /// before it received a new value.</param> public override void AuditEntityFieldSet(IEntityCore entity, int fieldIndex, object originalValue) { // Ignore the fieldSet of a new Order. The first original field values of an order can be reconstructed via the // AuditEntityFieldSet/AuditUpdateofExistingEntity history. However you also may colect AuditEntityFieldSet here // and then assign the sync those assigning OrderId when AuditInsertOfNewEntity is raised. The approach is up to you. if (entity.IsNew) { return; } // used to store the change experimented by a field. string originalValueAsString = originalValue == null ? "NULL" : originalValue.ToString(); var currentValue = entity.GetCurrentFieldValue(fieldIndex); string currentValueAsString = currentValue == null ? "NULL" : currentValue.ToString(); // post the field change audit info AddOrderAuditEntryToList( GetPrimaryKeyValueFromOrderEntity(entity), AuditType.EntityFieldSet, string.Format("FieldSet: {0}. OriginalValue: {1}. CurrentValue: {2}", entity.Fields.GetFieldInfo(fieldIndex).Name, originalValueAsString, currentValueAsString)); }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch(fieldName) { case "SalesPerson": SetupSyncSalesPerson(relatedEntity); break; default: break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch(propertyName) { case "SalesPerson": this.SalesPerson = (SalesPersonEntity)entity; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> setups the sync logic for member _customerDemographic</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncCustomerDemographic(IEntityCore relatedEntity) { if(_customerDemographic!=relatedEntity) { DesetupSyncCustomerDemographic(true, true); _customerDemographic = (CustomerDemographicEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _customerDemographic, new PropertyChangedEventHandler( OnCustomerDemographicPropertyChanged ), "CustomerDemographic", Northwind.Data.RelationClasses.StaticCustomerCustomerDemoRelations.CustomerDemographicEntityUsingCustomerTypeIdStatic, true, new string[] { } ); } }
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary> /// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> /// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param> protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne) { switch(fieldName) { case "Customer": DesetupSyncCustomer(false, true); break; case "CustomerDemographic": DesetupSyncCustomerDemographic(false, true); break; default: break; } }
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary> /// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> /// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param> protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne) { switch(fieldName) { case "Products": this.PerformRelatedEntityRemoval(this.Products, relatedEntity, signalRelatedEntityManyToOne); break; default: break; } }
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary> /// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> /// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param> protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne) { switch(fieldName) { case "AspnetUser": DesetupSyncAspnetUser(false, true); break; default: break; } }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch(fieldName) { case "AspnetUser": SetupSyncAspnetUser(relatedEntity); break; default: break; } }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch(fieldName) { case "Product": SetupSyncProduct(relatedEntity); break; default: break; } }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch(fieldName) { case "AspnetUser": SetupSyncAspnetUser(relatedEntity); break; case "SnFriendListMembers": this.SnFriendListMembers.Add((SnFriendListMemberEntity)relatedEntity); break; default: break; } }
/// <summary> setups the sync logic for member _artwork</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncArtwork(IEntityCore relatedEntity) { if(_artwork!=relatedEntity) { DesetupSyncArtwork(true, true); _artwork = (ArtworkEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _artwork, new PropertyChangedEventHandler( OnArtworkPropertyChanged ), "Artwork", TVJunkie.DatabaseAccessLayer.RelationClasses.StaticArtworkToRoleRelations.ArtworkEntityUsingArtworkIdStatic, true, new string[] { } ); } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch(propertyName) { case "Artwork": this.Artwork = (ArtworkEntity)entity; break; case "Role": this.Role = (RoleEntity)entity; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> setups the sync logic for member _salesPerson</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncSalesPerson(IEntityCore relatedEntity) { if(_salesPerson!=relatedEntity) { DesetupSyncSalesPerson(true, true); _salesPerson = (SalesPersonEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _salesPerson, new PropertyChangedEventHandler( OnSalesPersonPropertyChanged ), "SalesPerson", AdventureWorks.Dal.Adapter.v50.RelationClasses.StaticSalesPersonQuotaHistoryRelations.SalesPersonEntityUsingSalesPersonIdStatic, true, new string[] { } ); } }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch(fieldName) { case "Artwork": SetupSyncArtwork(relatedEntity); break; case "Role": SetupSyncRole(relatedEntity); break; default: break; } }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch(fieldName) { case "Products": this.Products.Add((ProductEntity)relatedEntity); break; default: break; } }
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary> /// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> /// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param> protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne) { switch(fieldName) { case "Artwork": DesetupSyncArtwork(false, true); break; case "Role": DesetupSyncRole(false, true); break; default: break; } }
protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch(propertyName) { case "Forums": _alreadyFetchedForums = true; if(entity!=null) { this.Forums.Add((ForumEntity)entity); } break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> setups the sync logic for member _role</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncRole(IEntityCore relatedEntity) { if(_role!=relatedEntity) { DesetupSyncRole(true, true); _role = (RoleEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _role, new PropertyChangedEventHandler( OnRolePropertyChanged ), "Role", TVJunkie.DatabaseAccessLayer.RelationClasses.StaticArtworkToRoleRelations.RoleEntityUsingRoleIdStatic, true, new string[] { } ); } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch(propertyName) { case "Address": this.Address = (AddressEntity)entity; break; case "AddressType": this.AddressType = (AddressTypeEntity)entity; break; case "BusinessEntity": this.BusinessEntity = (BusinessEntityEntity)entity; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary> /// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> /// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param> protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne) { switch(fieldName) { case "AspnetUser": DesetupSyncAspnetUser(false, true); break; case "SnFriendListMembers": this.PerformRelatedEntityRemoval(this.SnFriendListMembers, relatedEntity, signalRelatedEntityManyToOne); break; default: break; } }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch(fieldName) { case "Address": SetupSyncAddress(relatedEntity); break; case "AddressType": SetupSyncAddressType(relatedEntity); break; case "BusinessEntity": SetupSyncBusinessEntity(relatedEntity); break; default: break; } }
/// <summary> setups the sync logic for member _product</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncProduct(IEntityCore relatedEntity) { if(_product!=relatedEntity) { DesetupSyncProduct(true, true); _product = (ProductEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _product, new PropertyChangedEventHandler( OnProductPropertyChanged ), "Product", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticProductReviewRelations.ProductEntityUsingProductIdStatic, true, new string[] { } ); } }
/// <summary> Unsets the internal parameter related to the fieldname passed to the instance relatedEntity. Reverses the actions taken by SetRelatedEntity() </summary> /// <param name="relatedEntity">Instance to unset as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> /// <param name="signalRelatedEntityManyToOne">if set to true it will notify the manytoone side, if applicable.</param> protected override void UnsetRelatedEntity(IEntityCore relatedEntity, string fieldName, bool signalRelatedEntityManyToOne) { switch(fieldName) { case "Address": DesetupSyncAddress(false, true); break; case "AddressType": DesetupSyncAddressType(false, true); break; case "BusinessEntity": DesetupSyncBusinessEntity(false, true); break; default: break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch(propertyName) { case "AspnetUser": this.AspnetUser = (AspnetUsersEntity)entity; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> setups the sync logic for member _addressType</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncAddressType(IEntityCore relatedEntity) { if(_addressType!=relatedEntity) { DesetupSyncAddressType(true, true); _addressType = (AddressTypeEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _addressType, new PropertyChangedEventHandler( OnAddressTypePropertyChanged ), "AddressType", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticBusinessEntityAddressRelations.AddressTypeEntityUsingAddressTypeIdStatic, true, new string[] { } ); } }
/// <summary> setups the sync logic for member _aspnetUser</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncAspnetUser(IEntityCore relatedEntity) { if(_aspnetUser!=relatedEntity) { DesetupSyncAspnetUser(true, true); _aspnetUser = (AspnetUsersEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _aspnetUser, new PropertyChangedEventHandler( OnAspnetUserPropertyChanged ), "AspnetUser", MonoSoftware.MonoX.DAL.RelationClasses.StaticAuditInfoRelations.AspnetUsersEntityUsingUserIdStatic, true, new string[] { } ); } }
/// <summary> setups the sync logic for member _businessEntity</summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> private void SetupSyncBusinessEntity(IEntityCore relatedEntity) { if(_businessEntity!=relatedEntity) { DesetupSyncBusinessEntity(true, true); _businessEntity = (BusinessEntityEntity)relatedEntity; this.PerformSetupSyncRelatedEntity( _businessEntity, new PropertyChangedEventHandler( OnBusinessEntityPropertyChanged ), "BusinessEntity", AdventureWorks.Dal.Adapter.v41.RelationClasses.StaticBusinessEntityAddressRelations.BusinessEntityEntityUsingBusinessEntityIdStatic, true, new string[] { } ); } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch(propertyName) { case "Products": this.Products.Add((ProductEntity)entity); break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }
/// <summary> Sets the internal parameter related to the fieldname passed to the instance relatedEntity. </summary> /// <param name="relatedEntity">Instance to set as the related entity of type entityType</param> /// <param name="fieldName">Name of field mapped onto the relation which resolves in the instance relatedEntity</param> protected override void SetRelatedEntity(IEntityCore relatedEntity, string fieldName) { switch(fieldName) { case "Customer": SetupSyncCustomer(relatedEntity); break; case "CustomerDemographic": SetupSyncCustomerDemographic(relatedEntity); break; default: break; } }
public override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch(propertyName) { case "Role": this.Role = (RoleEntity)entity; break; case "User": this.User = (UserEntity)entity; break; default: break; } }
/// <summary> Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.</summary> /// <param name="propertyName">Name of the property.</param> /// <param name="entity">Entity to set as an related entity</param> /// <remarks>Used by prefetch path logic.</remarks> protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity) { switch(propertyName) { case "Customer": this.Customer = (CustomerEntity)entity; break; case "CustomerDemographic": this.CustomerDemographic = (CustomerDemographicEntity)entity; break; default: this.OnSetRelatedEntityProperty(propertyName, entity); break; } }