BExIS.Dlm.Services.Data.DatasetManager.UpdateDataTuple C# (CSharp) Method

UpdateDataTuple() public method

Provided that the data tuple entity contains some changes, the method persists the changes into the database.
public UpdateDataTuple ( DataTuple entity ) : DataTuple
entity BExIS.Dlm.Entities.Data.DataTuple The data tuple containing the changes.
return BExIS.Dlm.Entities.Data.DataTuple
        public DataTuple UpdateDataTuple(DataTuple 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<DataTuple>() != null && Contract.Result<DataTuple>().Id >= 0, "No entity is persisted!");

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