예제 #1
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;
        }
예제 #2
0
        public void ValidationTableColumnDef_Destroy(ValidationTableColumnDefViewModel valTableColumnDef)
        {
            var entity = new ValidationTableColumnDef();

            entity.Id = valTableColumnDef.Id;

            parameters.ValidationTableColumnDef.Attach(entity);

            parameters.ValidationTableColumnDef.Remove(entity);

            parameters.SaveChanges();
        }
예제 #3
0
        public void ValidationTableColumnDef_Update(ValidationTableColumnDefViewModel valTableColumnDef)
        {
            var entity = new ValidationTableColumnDef();

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

            parameters.ValidationTableColumnDef.Attach(entity);
            parameters.Entry(entity).State = EntityState.Modified;
            parameters.SaveChanges();
        }