Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request to support dynamic index type #505

Open
hyzx86 opened this issue Nov 6, 2023 · 2 comments
Open

Request to support dynamic index type #505

hyzx86 opened this issue Nov 6, 2023 · 2 comments

Comments

@hyzx86
Copy link
Contributor

hyzx86 commented Nov 6, 2023

for example, in the following code, I want for to support the base class and then return the object of the actual type in the Map

    public class CarIndex : MapIndex
    {
        public string Name { get; set; }
        public Categories Category { get; set; }
    }

    public class CarIndexProvider : IndexProvider<Car>
    {
        public override void Describe(DescribeContext<Car> context)
        {
            context
            .For<MapIndex>()
                .Map(c => new CarIndex
                {
                    Name = c.Name,
                    Category = c.Category,
                });
        }
    }

I am trying to use reflection implementation. It looks a bit complicated and difficult to understand. It would be much better if Yessql could support For(Type t)

image

@hyzx86 hyzx86 changed the title How do I make For<IIndex>().Map() support dynamic typing? How to make For<IIndex>().Map() support dynamic typing? Nov 6, 2023
@hyzx86 hyzx86 changed the title How to make For<IIndex>().Map() support dynamic typing? Request to support dynamic index type Dec 24, 2023
@hyzx86
Copy link
Contributor Author

hyzx86 commented Dec 24, 2023

Maybe it has been supported at present, but I don't know how to use it yet.

@hyzx86
Copy link
Contributor Author

hyzx86 commented Mar 10, 2024

relate : #525

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant