public virtual IAttributeSetInstanceExtensionFieldState Get(string index, bool forCreation, bool nullAllowed)
        {
            AttributeSetInstanceExtensionFieldId globalId = new AttributeSetInstanceExtensionFieldId(_attributeSetInstanceExtensionFieldGroupState.Id, index);

            if (_loadedAttributeSetInstanceExtensionFieldStates.ContainsKey(globalId))
            {
                return(_loadedAttributeSetInstanceExtensionFieldStates[globalId]);
            }
            if (forCreation || ForReapplying)
            {
                var state = new AttributeSetInstanceExtensionFieldState(ForReapplying);
                state.AttributeSetInstanceExtensionFieldId = globalId;
                _loadedAttributeSetInstanceExtensionFieldStates.Add(globalId, state);
                return(state);
            }
            else
            {
                var state = AttributeSetInstanceExtensionFieldStateDao.Get(globalId, nullAllowed);
                if (state != null)
                {
                    _loadedAttributeSetInstanceExtensionFieldStates.Add(globalId, state);
                }
                return(state);
            }
        }
        public virtual IAttributeSetInstanceExtensionFieldState ToAttributeSetInstanceExtensionFieldState()
        {
            var state = new AttributeSetInstanceExtensionFieldState(true);

            state.Index       = this.Index;
            state.Name        = this.Name;
            state.Type        = this.Type;
            state.Length      = this.Length;
            state.Alias       = this.Alias;
            state.Description = this.Description;
            if (this.Active != null && this.Active.HasValue)
            {
                state.Active = this.Active.Value;
            }
            if (this.Version != null && this.Version.HasValue)
            {
                state.Version = this.Version.Value;
            }
            state.GroupId   = this.GroupId;
            state.CreatedBy = this.CreatedBy;
            if (this.CreatedAt != null && this.CreatedAt.HasValue)
            {
                state.CreatedAt = this.CreatedAt.Value;
            }
            state.UpdatedBy = this.UpdatedBy;
            if (this.UpdatedAt != null && this.UpdatedAt.HasValue)
            {
                state.UpdatedAt = this.UpdatedAt.Value;
            }

            return(state);
        }
Exemplo n.º 3
0
 public static CreateAttributeSetInstanceExtensionField ToCreateAttributeSetInstanceExtensionField(this AttributeSetInstanceExtensionFieldState state)
 {
     return(state.ToCreateAttributeSetInstanceExtensionField <CreateAttributeSetInstanceExtensionField>());
 }
Exemplo n.º 4
0
 public static MergePatchAttributeSetInstanceExtensionField ToMergePatchAttributeSetInstanceExtensionField(this AttributeSetInstanceExtensionFieldState state)
 {
     return(state.ToMergePatchAttributeSetInstanceExtensionField <MergePatchAttributeSetInstanceExtensionField>());
 }
Exemplo n.º 5
0
 public static RemoveAttributeSetInstanceExtensionField ToRemoveAttributeSetInstanceExtensionField(this AttributeSetInstanceExtensionFieldState state)
 {
     return(state.ToRemoveAttributeSetInstanceExtensionField <RemoveAttributeSetInstanceExtensionField>());
 }
Exemplo n.º 6
0
 public static IAttributeSetInstanceExtensionFieldCommand ToCreateOrMergePatchAttributeSetInstanceExtensionField(this AttributeSetInstanceExtensionFieldState state)
 {
     return(state.ToCreateOrMergePatchAttributeSetInstanceExtensionField <CreateAttributeSetInstanceExtensionField, MergePatchAttributeSetInstanceExtensionField>());
 }