Exemple #1
0
        public static IEnumerable <IShipmentPackageState> ToShipmentPackageStateCollection(IEnumerable <ShipmentPackageId> ids)
        {
            var states = new List <ShipmentPackageState>();

            foreach (var id in ids)
            {
                var s = new ShipmentPackageState();
                s.ShipmentPackageId = id;
                states.Add(s);
            }
            return(states);
        }
        public IShipmentPackageState Get(ShipmentPackageId id, bool nullAllowed)
        {
            IShipmentPackageState state = CurrentSession.Get <ShipmentPackageState> (id);

            if (!nullAllowed && state == null)
            {
                state = new ShipmentPackageState();
                (state as ShipmentPackageState).ShipmentPackageId = id;
            }
            if (ReadOnlyProxyGenerator != null && state != null)
            {
                return(ReadOnlyProxyGenerator.CreateProxy <IShipmentPackageState>(state, new Type[] { typeof(ISaveable) }, _readOnlyPropertyNames));
            }
            return(state);
        }