public bool SavedataSet(Models.PythagorasValue pythagorasValue) { using (DB1Entities1 db = new DB1Entities1()) { db.PythagorasValues.Add(pythagorasValue); db.SaveChanges(); } return(true); }
public Models.PythagorasValue GetDataSet(int id) { var pInfo = new Models.PythagorasValue(); try { using (DB1Entities1 db = new DB1Entities1()) { pInfo = db.PythagorasValues.Where(p => p.Id == id).FirstOrDefault(); } return(pInfo); } catch (Exception ex) { throw new FaultException(ex.Message, new FaultCode("02 Data-fault")); } }