Example #1
0
        public Sheev.Common.Models.GenericResponse ConvertToResponse()
        {
            var response = new Sheev.Common.Models.GenericResponse();

            // Properties
            response.Id   = InternalId;
            response.Name = Name;

            return(response);
        }
        public Tagge.Common.Models.CategoryResponse ConvertToResponse()
        {
            var response = new Tagge.Common.Models.CategoryResponse();

            // Properties
            response.Id          = Id;
            response.Name        = Name;
            response.Description = Description;
            response.ParentId    = ParentId;

            // Category Sets
            if (CategorySets != null)
            {
                response.CategorySets = new List <Sheev.Common.Models.GenericResponse>();
                foreach (var categorySet in CategorySets)
                {
                    var singleSimpleResponse = new Sheev.Common.Models.GenericResponse()
                    {
                        Id   = categorySet.InternalId.ToString(),
                        Name = categorySet.Name
                    };

                    response.CategorySets.Add(singleSimpleResponse);
                }
            }

            // Custom Fields
            if (CustomFields != null)
            {
                response.CustomFields = new List <Tagge.Common.Models.GenericCustomFieldResponse>();
                foreach (var customField in CustomFields)
                {
                    response.CustomFields.Add(customField.ConvertToResponse());
                }
            }

            // ExternalIds - Managed in PC_ExternalId

            return(response);
        }