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

Query against AutoHistories with combining actual tables #36

Open
fabercs opened this issue Sep 11, 2019 · 0 comments
Open

Query against AutoHistories with combining actual tables #36

fabercs opened this issue Sep 11, 2019 · 0 comments

Comments

@fabercs
Copy link

fabercs commented Sep 11, 2019

I would like to use AutoHistory in my project where I need to query some history data with joining current data. Let's say I have an Order table

public class Order
{
    public int Id { get; set; }
    public OrderState OrderState { get; set; }
    public int ProductId { get; set; }
    public int UserId { get; set; }

    public DateTime CreatedOn { get; set; }
    public DateTime ModifiedOn { get; set; }
}
public enum OrderState
{
    Set=1,
    OnTheWay=2,
    Canceled=3
}

And I have an order record that is OnTheWay state. How can I query that what was the ModifiedOn column value before the state changed to OnTheWay from Set. This is just a simple case, we may have a lots of conditions depends on other columns, do you think it is costly to make use of this AutoHistory table like that?

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