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 ApiChainStatusServerResponseModel MapServerRequestToResponse(
            int id,
            ApiChainStatusServerRequestModel request)
        {
            var response = new ApiChainStatusServerResponseModel();

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

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

            return(model);
        }