Пример #1
0
        public virtual TViewModel MapFromClientParameters <TViewModel>(MasterfileParameter parameters) where TViewModel : DashboardSharedViewModel, new()
        {
            if (string.IsNullOrEmpty(parameters.SharedParameter))
            {
                return(new TViewModel());
            }

            var jSettings = new JsonSerializerSettings
            {
                Formatting           = Formatting.Indented,
                DateTimeZoneHandling = DateTimeZoneHandling.Utc
            };

            jSettings.Converters.Add(new DefaultWrongFormatDeserialize());
            var sharedModel = JsonConvert.DeserializeObject <TViewModel>(parameters.SharedParameter, jSettings
                                                                         );

            if (sharedModel != null)
            {
                sharedModel.CustomMappingRule();
            }
            return(sharedModel);
        }
Пример #2
0
 public virtual void ProcessFromClientParameters(MasterfileParameter parameters)
 {
     MapFromClientParameters(parameters);
 }
Пример #3
0
 //TODO: temporary this is virtual to prevent exception in build, wating for all childs refactoring,
 //this method should be abstract to force implementation in child
 public virtual void MapFromClientParameters(MasterfileParameter parameters)
 {
     throw new NotImplementedException();
 }