Esempio n. 1
0
        protected void ValidateHost(Host host)
        {
            var codeExample = new Host {
                HostName = host.HostName
            };

            Check.Require(_hostRepository.GetCountByExample(codeExample, host.Id) == 0,
                          "A host with this name already exist.");

            //// If one of the properties has a value, then both must have a valid.  Both properties being blank is also valid.
            //if (host.LastRestoredByUserId.HasValue | host.LastRestoredDate.HasValue)
            //{
            //    const string msg = "Restore Tested By and Restore Tested Date must be entered as a pair.";
            //    Check.Require(host.LastRestoredByUserId.HasValue, msg);
            //    Check.Require(host.LastRestoredDate.HasValue, msg);
            //}
        }