/// <summary> /// 更新记录 /// </summary> /// <param name="entity"></param> /// <returns></returns> public override bool Update(Domain.Attribute entity) { var result = false; var original = FindById(entity.AttributeId); using (UnitOfWork.Build(DbContext)) { result = _repository.Update(entity); //如果字段长度更改,并且大于原有的长度 if (entity.MaxLength > original.MaxLength) { //更改数据库表字段 _metadataProvider.AlterColumn(entity); } } return(result); }
public void AlterColumn(Domain.Attribute attr) { _metadataProvider.AlterColumn(attr); }