MonoSoftware.MonoX.DAL.EntityClasses.PollEntity.SetRelatedEntityProperty C# (CSharp) Method

SetRelatedEntityProperty() protected method

Sets the related entity property to the entity specified. If the property is a collection, it will add the entity specified to that collection.
Used by prefetch path logic.
protected SetRelatedEntityProperty ( string propertyName, IEntityCore entity ) : void
propertyName string Name of the property.
entity IEntityCore Entity to set as an related entity
return void
        protected override void SetRelatedEntityProperty(string propertyName, IEntityCore entity)
        {
            switch(propertyName)
            {
                case "AspnetApplication":
                    this.AspnetApplication = (AspnetApplicationsEntity)entity;
                    break;
                case "AspnetUser":
                    this.AspnetUser = (AspnetUsersEntity)entity;
                    break;
                case "PollAnswers":
                    this.PollAnswers.Add((PollAnswerEntity)entity);
                    break;
                case "PollLocalizations":
                    this.PollLocalizations.Add((PollLocalizationEntity)entity);
                    break;
                case "SnRelationshipss":
                    this.SnRelationshipss.Add((SnRelationshipEntity)entity);
                    break;
                default:
                    this.OnSetRelatedEntityProperty(propertyName, entity);
                    break;
            }
        }