efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Break point pass until the context.SaveChanges but doesn't save to the database.

Open ethlyseria opened this issue 7 years ago • 3 comments

Good day,

I'm trying to save in my table using Entity Framework. Here's my sample code:

public async Task<bool> Create(Fruit fruit)
        {
            try
            {
                context.Fruits.Add(fruit);
                await context.SaveChangesAsync();
                return true;
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                return false;
            }
        }

I put the break point, and it didn't go to catch but it doesn't save in the database. I also notice that my id has a value of -2147482647

Any help?

ethlyseria avatar May 07 '19 07:05 ethlyseria

This information does not say much! Provide enough data for repro.

ralmsdeveloper avatar May 07 '19 13:05 ralmsdeveloper

@ethlyseria Please post a small, runnable project/solution or complete code listing that demonstrates the behavior you are seeing.

ajcvickers avatar May 07 '19 17:05 ajcvickers

EF Team Triage: Closing this issue as the requested additional details have not been provided and we have been unable to reproduce it.

BTW this is a canned response and may have info or details that do not directly apply to this particular issue. While we'd like to spend the time to uniquely address every incoming issue, we get a lot traffic on the EF projects and that is not practical. To ensure we maximize the time we have to work on fixing bugs, implementing new features, etc. we use canned responses for common triage decisions.

ajcvickers avatar May 17 '19 16:05 ajcvickers