public static IEnumerable <IPhysicalInventoryState> ToPhysicalInventoryStateCollection(IEnumerable <string> ids) { var states = new List <PhysicalInventoryState>(); foreach (var id in ids) { var s = new PhysicalInventoryState(); s.DocumentNumber = id; states.Add(s); } return(states); }
public IPhysicalInventoryState Get(string id, bool nullAllowed) { IPhysicalInventoryState state = CurrentSession.Get <PhysicalInventoryState> (id); if (!nullAllowed && state == null) { state = new PhysicalInventoryState(); (state as PhysicalInventoryState).DocumentNumber = id; } if (ReadOnlyProxyGenerator != null && state != null) { return(ReadOnlyProxyGenerator.CreateProxy <IPhysicalInventoryState>(state, new Type[] { typeof(ISaveable) }, _readOnlyPropertyNames)); } return(state); }