public bool Update(GoroheSaze goroheSaze) { try { var local = _uow.Set <GoroheSaze>() .Local .FirstOrDefault(f => f.ID == goroheSaze.ID); if (local != null) { _uow.Entry(local).State = EntityState.Detached; } //var local2 = _uow.Set<Saze>() // .Local // .FirstOrDefault(f => f.ID == goroheSaze.Sazes.ID); //if (local2 != null) //{ // _uow.Entry(local).State = EntityState.Detached; //} _goroheSazes.Attach(goroheSaze); _uow.Entry(goroheSaze).State = EntityState.Modified; return(true); } catch (Exception ex) { return(false); } }
public bool Insert(GoroheSaze goroheSaze) { try { _goroheSazes.Add(goroheSaze); return(true); } catch (Exception) { return(false); } }
public bool Delete(GoroheSaze goroheSaze) { try { _goroheSazes.Attach(goroheSaze); _goroheSazes.Remove(goroheSaze); return(true); } catch (Exception) { return(false); } }