コード例 #1
0
        public virtual ApiOfficerCapabilitiesServerResponseModel MapEntityToModel(
            OfficerCapabilities item)
        {
            var model = new ApiOfficerCapabilitiesServerResponseModel();

            model.SetProperties(item.Id,
                                item.CapabilityId,
                                item.OfficerId);
            if (item.CapabilityIdNavigation != null)
            {
                var capabilityIdModel = new ApiOffCapabilityServerResponseModel();
                capabilityIdModel.SetProperties(
                    item.CapabilityIdNavigation.Id,
                    item.CapabilityIdNavigation.Name);

                model.SetCapabilityIdNavigation(capabilityIdModel);
            }

            if (item.OfficerIdNavigation != null)
            {
                var officerIdModel = new ApiOfficerServerResponseModel();
                officerIdModel.SetProperties(
                    item.OfficerIdNavigation.Id,
                    item.OfficerIdNavigation.Badge,
                    item.OfficerIdNavigation.Email,
                    item.OfficerIdNavigation.FirstName,
                    item.OfficerIdNavigation.LastName,
                    item.OfficerIdNavigation.Password);

                model.SetOfficerIdNavigation(officerIdModel);
            }

            return(model);
        }
コード例 #2
0
        public virtual ApiOffCapabilityServerResponseModel MapServerRequestToResponse(
            int id,
            ApiOffCapabilityServerRequestModel request)
        {
            var response = new ApiOffCapabilityServerResponseModel();

            response.SetProperties(id,
                                   request.Name);
            return(response);
        }
コード例 #3
0
        public virtual ApiOffCapabilityServerResponseModel MapEntityToModel(
            OffCapability item)
        {
            var model = new ApiOffCapabilityServerResponseModel();

            model.SetProperties(item.Id,
                                item.Name);

            return(model);
        }