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

ODSController does not update nullable columns to null values #6

Open
BeamRider opened this issue Nov 11, 2009 · 0 comments
Open

ODSController does not update nullable columns to null values #6

BeamRider opened this issue Nov 11, 2009 · 0 comments

Comments

@BeamRider
Copy link

SubSonic 2.2.1

When using the Update method on ODSController (ie using GridView / FormView in an ASP.NET application) and passing null values to nullable columns, the nullable column value remains unchanged.

This is due to the way that update method instantiate the ActiveRecord to update:

    public void Update(Guid MyKey, ...)
    {
        MyItem item =  new MyItem();
        item.MarkOld();
        item.IsLoaded = true;
        ...
        item.Save(UserName);
    }

By creating an empty MyItem instance (all fields are null) and setting a nullable field to null doesn' t allow the column to finish in the DirtyColumns collection (see ActiveHelper GetUpdateCommand).

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