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

refactor(IsNew): check string type PrimaryKey first #538 #542

Merged
merged 3 commits into from Aug 2, 2019

Conversation

ArgoZhang
Copy link
Contributor

#Issue
link #538

@pleb
Copy link
Member

pleb commented Jun 11, 2019

Hey @ArgoZhang why was this causing an issue? I don't see how this change affects anything.

@ArgoZhang
Copy link
Contributor Author

ArgoZhang commented Jun 11, 2019

Hey @ArgoZhang why was this causing an issue? I don't see how this change affects anything.

[TableName("Groups")]
public class Group
{
    public string Id { get; set; }
    public string GroupName { get; set; }

    public void Save(Group poco)
    {
        var db = DbManager.Create();
        db.Save(new Group() { Id = "", GroupName = "UnitTest" });
    }
}

because Id value is String.Empty not null, so IsNew method work incorrectly.
the IsNew method will always run false when PrimaryKey is string type and value is "". so run into Update method.
i think that this is a bug. and you?
by the way it works when value is NULL

@pleb
Copy link
Member

pleb commented Aug 1, 2019

@ArgoZhang could you please fix the line endings?

@ArgoZhang
Copy link
Contributor Author

@pleb done! resolved the conflicts.
thank you for pick up this PR.
😃

@pleb pleb merged commit 401c49e into CollaboratingPlatypus:development Aug 2, 2019
@ArgoZhang ArgoZhang deleted the dev-StringPrimary branch August 2, 2019 04:43
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

Successfully merging this pull request may close these issues.

None yet

2 participants