Closed iamprovidence closed 5 years ago
In Project/DataAccess/Context/AppContext.cs inside SaveChanges method we convert ObserveableCollection to IQueryable and then to List. I do not see reason why we do so. Should be check if it works without ToList method, it might save up times
also we have
PhotoLike.Local.Where(ph => ph.Photo == null && ph.User == null).ToList().ForEach(ph => PhotoLike.Remove(ph));
maybe this one would be faster, because in this way we do not search for each entity
PhotoLike.Local.Where(ph => ph.Photo == null && ph.User == null).ToList().ForEach(ph => Entry(ph).State=EntityState.Deleted);
or even with SQL But we should try this after all test has been successfully passed with current code version
In Project/DataAccess/Context/AppContext.cs inside SaveChanges method we convert ObserveableCollection to IQueryable and then to List. I do not see reason why we do so. Should be check if it works without ToList method, it might save up times
also we have
maybe this one would be faster, because in this way we do not search for each entity
or even with SQL But we should try this after all test has been successfully passed with current code version