Ejemplo n.º 1
0
        public Maybe <ItInterfaceExhibit> ChangeExhibitingSystem(Maybe <ItSystem> system)
        {
            if (system.IsNone)
            {
                ExhibitedBy = null;
            }
            else
            {
                var newSystem = system.Value;

                var changed =
                    ExhibitedBy == null ||
                    (newSystem.Id != ExhibitedBy.ItSystem.Id);

                if (changed)
                {
                    ExhibitedBy = new ItInterfaceExhibit
                    {
                        ItInterface = this,
                        ItSystem    = newSystem
                    };
                }
            }

            return(ExhibitedBy);
        }
Ejemplo n.º 2
0
        public bool TryGetInterfaceExhibit(out ItInterfaceExhibit interfaceExhibit, int interfaceId)
        {
            interfaceExhibit = ItInterfaceExhibits.FirstOrDefault(i => i.ItInterface.Id == interfaceId);

            return(interfaceExhibit != null);
        }