コード例 #1
0
        public void SaveCompra()
        {
            try
            {
                context.SaveChanges();
            }
            catch (DbEntityValidationException ex)
            {
                foreach (var failure in ex.EntityValidationErrors)
                {
                    string validationErrors = "";

                    foreach (var error in failure.ValidationErrors)
                    {
                        validationErrors += error.PropertyName + "  " + error.ErrorMessage;
                    }
                }
            }
        }
 public void SaveEstabelecimento()
 {
     context.SaveChanges();
 }
 public void SaveCategoria()
 {
     context.SaveChanges();
 }