public IAttributeValueMvoState Get(AttributeValueId id) { IAttributeValueMvoState state = CurrentSession.Get <AttributeValueMvoState> (id); if (state == null) { state = new AttributeValueMvoState(); (state as AttributeValueMvoState).AttributeValueId = id; } return(state); }
public static IEnumerable <IAttributeValueMvoState> ToAttributeValueMvoStateCollection(IEnumerable <AttributeValueId> ids) { var states = new List <AttributeValueMvoState>(); foreach (var id in ids) { var s = new AttributeValueMvoState(); s.AttributeValueId = id; states.Add(s); } return(states); }
public IAttributeValueMvoState Get(AttributeValueId id, bool nullAllowed) { IAttributeValueMvoState state = CurrentSession.Get <AttributeValueMvoState> (id); if (!nullAllowed && state == null) { state = new AttributeValueMvoState(); (state as AttributeValueMvoState).AttributeValueId = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IAttributeValueMvoState>(state, new Type[] { }, _readOnlyPropertyNames)); } return(state); }