Esempio n. 1
0
        public static UM_Rule ToEntity(this RuleContract contract)
        {
            if (contract == null)
            {
                return(null);
            }

            var entity = new UM_Rule();

            entity.DateChanged = contract.DateChanged;
            entity.DateCreated = contract.DateCreated;
            entity.DateDeleted = contract.DateDeleted;
            entity.ID          = contract.ID;
            entity.ProjectID   = contract.ProjectID;
            entity.Name        = contract.Name;
            entity.AccessLevel = contract.AccessLevel;
            entity.CanAdd      = contract.CanAdd;
            entity.CanDelete   = contract.CanDelete;
            entity.CanEdit     = contract.CanEdit;
            entity.CanView     = contract.CanView;


            return(entity);
        }
Esempio n. 2
0
        public static RuleContract ToContract(this UM_Rule entity)
        {
            if (entity == null)
            {
                return(null);
            }


            var contract = new RuleContract();

            contract.DateChanged = entity.DateChanged;
            contract.DateCreated = entity.DateCreated;
            contract.DateDeleted = entity.DateDeleted;
            contract.ID          = entity.ID;
            contract.ProjectID   = entity.ProjectID;
            contract.Name        = entity.Name;
            contract.AccessLevel = entity.AccessLevel;
            contract.CanAdd      = entity.CanAdd;
            contract.CanDelete   = entity.CanDelete;
            contract.CanEdit     = entity.CanEdit;
            contract.CanView     = entity.CanView;

            return(contract);
        }