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