public string excluirUf(uf uf) { string erro = null; try { ufs.DeleteObject(uf); db.SaveChanges(); } catch (Exception ex) { erro = ex.Message; } return erro; }
public string adicionarUf(uf uf) { string erro = null; try { ufs.AddObject(uf); db.SaveChanges(); } catch (Exception ex) { erro = ex.Message; } return erro; }
public string editarUf(uf uf) { string erro = null; try { if (uf.EntityState == System.Data.EntityState.Detached) { ufs.Attach(uf); } db.ObjectStateManager.ChangeObjectState(uf, System.Data.EntityState.Modified); db.SaveChanges(); } catch (Exception ex) { erro = ex.Message; } return erro; }
/// <summary> /// Deprecated Method for adding a new object to the uf EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddTouf(uf uf) { base.AddObject("uf", uf); }
/// <summary> /// Create a new uf object. /// </summary> /// <param name="uF">Initial value of the UF property.</param> /// <param name="estado">Initial value of the Estado property.</param> public static uf Createuf(global::System.String uF, global::System.String estado) { uf uf = new uf(); uf.UF = uF; uf.Estado = estado; return uf; }