Glass.Mapper.Configuration.AbstractTypeConfiguration.MapPropertiesToObject C# (CSharp) Метод

MapPropertiesToObject() публичный Метод

Maps the properties to object.
public MapPropertiesToObject ( object obj, IAbstractService service, AbstractTypeCreationContext context ) : void
obj object The obj.
service IAbstractService The service.
context AbstractTypeCreationContext The context.
Результат void
        public void MapPropertiesToObject( object obj, IAbstractService service, AbstractTypeCreationContext context)
        {
            try
            {
                //create properties 
                AbstractDataMappingContext dataMappingContext = service.CreateDataMappingContext(context, obj);


                for (int i = Properties.Length - 1; i >= 0; i--)
                {
                    var prop = Properties[i];

                    try
                    {
                        prop.Mapper.MapCmsToProperty(dataMappingContext);
                    }
                    catch (MapperStackException)
                    {
                        throw;
                    }
                    catch (Exception e)
                    {
                        throw new MapperException(
                            "Failed to map property {0} on {1}".Formatted(prop.PropertyInfo.Name,
                                prop.PropertyInfo.DeclaringType.FullName), e);
                    }

                }
            }
            catch (MapperStackException)
            {
                throw;
            }
            catch (Exception ex)
            {
                throw new MapperException(
                           "Failed to map properties on {0}.".Formatted(context.DataSummary()), ex);
            }
        }