yessql icon indicating copy to clipboard operation
yessql copied to clipboard

Allow describing an index from a given `Type`.

Open hyzx86 opened this issue 6 months ago • 23 comments

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
            });
    }
}

hyzx86 avatar Dec 28 '23 16:12 hyzx86