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

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

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
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

2 participants