Exemplo n.º 1
0
        public virtual ApiChainServerResponseModel MapEntityToModel(
            Chain item)
        {
            var model = new ApiChainServerResponseModel();

            model.SetProperties(item.Id,
                                item.ChainStatusId,
                                item.ExternalId,
                                item.Name,
                                item.TeamId);
            if (item.ChainStatusIdNavigation != null)
            {
                var chainStatusIdModel = new ApiChainStatusServerResponseModel();
                chainStatusIdModel.SetProperties(
                    item.ChainStatusIdNavigation.Id,
                    item.ChainStatusIdNavigation.Name);

                model.SetChainStatusIdNavigation(chainStatusIdModel);
            }

            if (item.TeamIdNavigation != null)
            {
                var teamIdModel = new ApiTeamServerResponseModel();
                teamIdModel.SetProperties(
                    item.TeamIdNavigation.Id,
                    item.TeamIdNavigation.Name,
                    item.TeamIdNavigation.OrganizationId);

                model.SetTeamIdNavigation(teamIdModel);
            }

            return(model);
        }
Exemplo n.º 2
0
        public virtual ApiTeamServerResponseModel MapServerRequestToResponse(
            int id,
            ApiTeamServerRequestModel request)
        {
            var response = new ApiTeamServerResponseModel();

            response.SetProperties(id,
                                   request.Name,
                                   request.OrganizationId);
            return(response);
        }
Exemplo n.º 3
0
        public virtual ApiTeamServerResponseModel MapEntityToModel(
            Team item)
        {
            var model = new ApiTeamServerResponseModel();

            model.SetProperties(item.Id,
                                item.Name,
                                item.OrganizationId);
            if (item.OrganizationIdNavigation != null)
            {
                var organizationIdModel = new ApiOrganizationServerResponseModel();
                organizationIdModel.SetProperties(
                    item.OrganizationIdNavigation.Id,
                    item.OrganizationIdNavigation.Name);

                model.SetOrganizationIdNavigation(organizationIdModel);
            }

            return(model);
        }