Exemple #1
0
 public bool SavedataSet(Models.PythagorasValue pythagorasValue)
 {
     using (DB1Entities1 db = new DB1Entities1())
     {
         db.PythagorasValues.Add(pythagorasValue);
         db.SaveChanges();
     }
     return(true);
 }
Exemple #2
0
        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"));
            }
        }