Skip to content

Entity Framework. Save question #16

Open
@XmyriyCat

Description

@XmyriyCat
Hi, I have a little question. You have the Save method in the FoodSqlRepository class. However, this method always return positive number from 0, because the returned number is the number of state entries written to the database.
In which cases can the returned number be negative?
public class FoodSqlRepository : IFoodRepository
{
        // your code

        public bool Save()
        {
            return (_foodDbContext.SaveChanges() >= 0);
        }
}

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