Skip to content

Show how to take a DataAccess obj and save as keyless #4250

New issue

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

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

Already on GitHub? # to your account

Closed
wayneh654 opened this issue Feb 11, 2023 · 1 comment
Closed

Show how to take a DataAccess obj and save as keyless #4250

wayneh654 opened this issue Feb 11, 2023 · 1 comment

Comments

@wayneh654
Copy link

[Enter feedback here]
What your not showing is how to Create a entry with a keyless from a DTO
EG

//convert the DTO to a obj that has no key, (keyless)
var obj = _mapper.Map<KeylessDTOTable, KeylessTable>(objDTO);
_dbWaterConsentsSamples.Add(obj);
//Then add and bingo - a error.
//How do I add a keyless obj to EF Core. That's what I and many want to know how
int status = _dbWaterConsentsSamples.SaveChanges();

Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

@ajcvickers
Copy link
Contributor

This is tracked by dotnet/efcore#29897

@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Feb 15, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants