public ActionResult Create([Bind(Include = "Id,FirstName,LastName,CreationDate")] Contact contact)
        {
            if (ModelState.IsValid)
            {
                db.Contacts.Add(contact);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(contact));
        }
Exemple #2
0
        public void ValidationTableColumnDef_Create(ValidationTableColumnDefViewModel valTableColumnDef)
        {
            var entity = new ValidationTableColumnDef();

            entity.TableName  = valTableColumnDef.TableName;
            entity.ColumnName = valTableColumnDef.ColumnName;

            parameters.ValidationTableColumnDef.Add(entity);
            parameters.SaveChanges();

            valTableColumnDef.Id = entity.Id;
        }