Exemplo n.º 1
0
        public virtual TViewModel MapFromClientParameters <TViewModel>(MasterfileParameter parameters) where TViewModel : DashboardSharedViewModel
        {
            if (string.IsNullOrEmpty(parameters.SharedParameter))
            {
                return(null);
            }


            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);
        }
Exemplo n.º 2
0
 public virtual void ProcessFromClientParameters(MasterfileParameter parameters)
 {
     MapFromClientParameters(parameters);
 }
Exemplo n.º 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();
 }