Esempio n. 1
0
        public virtual ApiSpeciesServerResponseModel MapEntityToModel(
            Species item)
        {
            var model = new ApiSpeciesServerResponseModel();

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

            return(model);
        }
Esempio n. 2
0
        public virtual ApiSpeciesServerResponseModel MapServerRequestToResponse(
            int id,
            ApiSpeciesServerRequestModel request)
        {
            var response = new ApiSpeciesServerResponseModel();

            response.SetProperties(id,
                                   request.Name);
            return(response);
        }
Esempio n. 3
0
        public virtual ApiBreedServerResponseModel MapEntityToModel(
            Breed item)
        {
            var model = new ApiBreedServerResponseModel();

            model.SetProperties(item.Id,
                                item.Name,
                                item.SpeciesId);
            if (item.SpeciesIdNavigation != null)
            {
                var speciesIdModel = new ApiSpeciesServerResponseModel();
                speciesIdModel.SetProperties(
                    item.SpeciesIdNavigation.Id,
                    item.SpeciesIdNavigation.Name);

                model.SetSpeciesIdNavigation(speciesIdModel);
            }

            return(model);
        }