Skip to content

Suggestions: how to retrieve ID generated by DB after saveChanges()  #65

Open
@chaoscn

Description

@chaoscn

Hi,

We are using our database to generate ID instead from C# code, that means. The Id of a newly created object is only visible after dbContextScope.SaveChanges() is called. However, the mapping between EF models and domain models already happened in the repository layer which is before saveChanges() been called. This leads to a result that the domain object returned by the add method do not have the ID.
How can I get around this issue?

Thanks,
Chenhao Gao

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions