示例#1
0
文件: Client.cs 项目: mr0zek/Examples
        public void Charge(int clientId, decimal amount)
        {
            Client1 client = _repository.Get(clientId);

            if (client.IsVip() && client.MoneyLeft > 0)
            {
                client.MoneyLeft -= amount;
            }
        }
示例#2
0
文件: LOD.cs 项目: mr0zek/Examples
        public void Process(Data input)
        {
            ProcessStep1();
            input.ProcessStep2();

            Data temporary = new Data();

            Client1 data = _repositry.Get(1);


            input.Param1.DoStap2(); // ERROR - violation of Law of Demeter!!!
        }