public void RenameResource(long resourceId, ResourceContract resource)
        {
            try
            {
                Put <object>($"resource/{resourceId}", resource);
            }
            catch (HttpRequestException e)
            {
                if (m_logger.IsErrorEnabled())
                {
                    m_logger.LogError("{0} failed with {1}", GetCurrentMethod(), e);
                }

                throw;
            }
        }
Beispiel #2
0
        public static ResourceContract ToContract(this UM_Resource entity)
        {
            if (entity == null)
            {
                return(null);
            }

            var contract = new ResourceContract();

            contract.DateChanged = entity.DateChanged;
            contract.DateCreated = entity.DateCreated;
            contract.Description = entity.Description;
            contract.ID          = entity.ID;
            contract.Name        = entity.Name;
            contract.Type        = (RuleTypesEnum)entity.Type;
            contract.ParentID    = entity.ParentID;
            contract.Value       = entity.Value;
            contract.ProjectID   = entity.ProjectID;
            return(contract);
        }
Beispiel #3
0
        public static UM_Resource ToEntity(this ResourceContract contract)
        {
            if (contract == null)
            {
                return(null);
            }

            var entity = new UM_Resource();

            entity.DateChanged = contract.DateChanged;
            entity.DateCreated = contract.DateCreated;
            entity.DateDeleted = contract.DateDeleted;
            entity.Description = contract.Description;
            entity.ID          = contract.ID;
            entity.Type        = Convert.ToInt32(contract.Type);
            entity.Name        = contract.Name;
            entity.ParentID    = contract.ParentID;
            entity.Value       = contract.Value;
            entity.ProjectID   = contract.ProjectID;

            return(entity);
        }
 public void RenameResource(long resourceId, [FromBody] ResourceContract resource)
 {
 }