BExIS.Dlm.Services.MetadataStructure.MetadataAttributeManager.Update C# (CSharp) Метод

Update() публичный Метод

public Update ( MetadataAttribute entity ) : MetadataAttribute
entity BExIS.Dlm.Entities.MetadataStructure.MetadataAttribute
Результат BExIS.Dlm.Entities.MetadataStructure.MetadataAttribute
        public MetadataAttribute Update(MetadataAttribute entity)
        {
            Contract.Requires(entity != null, "provided entity can not be null");
            Contract.Requires(entity.Id >= 0, "provided entity must have a permanent ID");

            Contract.Ensures(Contract.Result<MetadataAttribute>() != null && Contract.Result<MetadataAttribute>().Id >= 0, "No entity is persisted!");

            using (IUnitOfWork uow = this.GetUnitOfWork())
            {
                IRepository<MetadataAttribute> repo = uow.GetRepository<MetadataAttribute>();
                repo.Put(entity); // Merge is required here!!!!
                uow.Commit();
            }
            return (entity);
        }