yessql
yessql copied to clipboard
Allow describing an index from a given `Type`.
Here is an example
public class PropertyDynamicIndexProvider : IndexProvider<Property>
{
public override void Describe(DescribeContext<Property> context)
{
context
.For(typeof(PropertyIndex)) // in addition to the existing ".For<PropertyIndex>()"
.Map(property => new PropertyIndex
{
Name = property.Name,
ForRent = property.ForRent,
IsOccupied = property.IsOccupied,
Location = property.Location
});
}
}