コード例 #1
0
        public override Task <int> GetValue(IItemOfValue subject)
        {
            if (subject.Kind != ItemType.Property)
            {
                throw new Exception($"Unable to estimate value of invalid type: {subject.Kind}");
            }

            return(Task.FromResult(subject.Value));
        }
コード例 #2
0
        public static IEstimator GetEstimator(IItemOfValue item)
        {
            IEstimator estimator;

            switch (item.Kind)
            {
            case ItemType.Property:
                estimator = new PropertyEstimator();
                break;

            case ItemType.Vehicle:
                estimator = new VehicleEstimator();
                break;

            default:
                estimator = new GenericEstimator();
                break;
            }

            return(estimator);
        }
コード例 #3
0
 public override Task <int> GetValue(IItemOfValue subject)
 {
     return(Task.FromResult(subject.Value));
 }
コード例 #4
0
 public abstract Task <int> GetValue(IItemOfValue subject);