Glass.Mapper.Sc.DataMappers.SitecoreNodeMapper.CanHandle C# (CSharp) Method

CanHandle() public method

Indicates that the data mapper will mapper to and from the property
public CanHandle ( AbstractPropertyConfiguration configuration, Context context ) : bool
configuration Glass.Mapper.Configuration.AbstractPropertyConfiguration The configuration.
context Context The context.
return bool
        public override bool CanHandle(AbstractPropertyConfiguration configuration, Context context)
        {
            return configuration is SitecoreNodeConfiguration;
        }
    }

Usage Example

        public void CanHandle_ConfigIsNodeAndClassMapped_ReturnsTrue()
        {
            //Assign
            var config = new SitecoreNodeConfiguration();
            var mapper = new SitecoreNodeMapper();

            //Act
            var result = mapper.CanHandle(config, null);

            //Assert
            Assert.IsTrue(result);
        }
All Usage Examples Of Glass.Mapper.Sc.DataMappers.SitecoreNodeMapper::CanHandle