Exemple #1
0
        internal static ExpertClassEstimation Read(this ExpertClassEstimationEntity entity,
                                                   ReadConversionCollector collector)
        {
            if (entity == null)
            {
                throw new ArgumentNullException(nameof(entity));
            }
            if (collector == null)
            {
                throw new ArgumentNullException(nameof(collector));
            }

            if (collector.Contains(entity))
            {
                return(collector.Get(entity));
            }

            var estimation = new ExpertClassEstimation
            {
                Expert             = entity.ExpertEntity.Read(collector),
                HydraulicCondition = entity.HydraulicConditionElementEntity.Read(collector),
                AverageEstimation  = (ProbabilityClass)entity.AverageEstimation,
                MinEstimation      = (ProbabilityClass)entity.MinEstimation,
                MaxEstimation      = (ProbabilityClass)entity.MaxEstimation
                                     // TODO: Add Comment
            };

            collector.Collect(entity, estimation);

            return(estimation);
        }
        internal static ExpertClassEstimationEntity Create(this ExpertClassEstimation model, PersistenceRegistry registry)
        {
            var entity = new ExpertClassEstimationEntity
            {
                ExpertEntity = model.Expert.Create(registry),
                HydraulicConditionElementEntity = model.HydraulicCondition.Create(registry),
                AverageEstimation = Convert.ToByte(model.AverageEstimation),
                MaxEstimation     = Convert.ToByte(model.MaxEstimation),
                MinEstimation     = Convert.ToByte(model.MinEstimation),
                // TODO: Add Comment to data model and map
            };

            return(entity);
        }
 internal void Collect(ExpertClassEstimationEntity entity, ExpertClassEstimation model)
 {
     Collect(expertClassEstimations, entity, model);
 }
 public ExpertClassEstimationViewModel(ExpertClassEstimation estimation)
 {
     this.estimation = estimation;
 }