示例#1
0
        public virtual ApiMachineResponseModel MapBOToModel(
            BOMachine boMachine)
        {
            var model = new ApiMachineResponseModel();

            model.SetProperties(boMachine.Id, boMachine.CommunicationStyle, boMachine.EnvironmentIds, boMachine.Fingerprint, boMachine.IsDisabled, boMachine.JSON, boMachine.MachinePolicyId, boMachine.Name, boMachine.RelatedDocumentIds, boMachine.Roles, boMachine.TenantIds, boMachine.TenantTags, boMachine.Thumbprint);

            return(model);
        }
        public virtual BOMachine MapEFToBO(
            Machine ef)
        {
            var bo = new BOMachine();

            bo.SetProperties(
                ef.Id,
                ef.CommunicationStyle,
                ef.EnvironmentIds,
                ef.Fingerprint,
                ef.IsDisabled,
                ef.JSON,
                ef.MachinePolicyId,
                ef.Name,
                ef.RelatedDocumentIds,
                ef.Roles,
                ef.TenantIds,
                ef.TenantTags,
                ef.Thumbprint);
            return(bo);
        }
        public virtual Machine MapBOToEF(
            BOMachine bo)
        {
            Machine efMachine = new Machine();

            efMachine.SetProperties(
                bo.CommunicationStyle,
                bo.EnvironmentIds,
                bo.Fingerprint,
                bo.Id,
                bo.IsDisabled,
                bo.JSON,
                bo.MachinePolicyId,
                bo.Name,
                bo.RelatedDocumentIds,
                bo.Roles,
                bo.TenantIds,
                bo.TenantTags,
                bo.Thumbprint);
            return(efMachine);
        }
示例#4
0
        public virtual BOMachine MapModelToBO(
            string id,
            ApiMachineRequestModel model
            )
        {
            BOMachine boMachine = new BOMachine();

            boMachine.SetProperties(
                id,
                model.CommunicationStyle,
                model.EnvironmentIds,
                model.Fingerprint,
                model.IsDisabled,
                model.JSON,
                model.MachinePolicyId,
                model.Name,
                model.RelatedDocumentIds,
                model.Roles,
                model.TenantIds,
                model.TenantTags,
                model.Thumbprint);
            return(boMachine);
        }