BExIS.Dlm.Services.DataStructure.AggregateFunctionManager.Update C# (CSharp) Метод

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

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

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

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