예제 #1
0
 public Api.ArticleProperty DomainToApi(ArticleProperty value)
 {
     return(new Api.ArticleProperty
     {
         Id = value.Id,
         ArticleId = value.ArticleId,
         ArticlePropertyId = value.ArticlePropertyId,
         Type = value.Type.ToApiValue(),
         Name = value.Name,
         Value = MappingHelpers.ParsePropertyValue(value.Type, value.Value)
     });
 }
        public Api.ClientProperty DomainToApi(ClientProperty value)
        {
            if (value == null)
            {
                return(null);
            }

            return(new Api.ClientProperty
            {
                Id = value.Id,
                ClientId = value.ClientId,
                ClientPropertyId = value.ClientPropertyId,
                Type = value.Type.ToApiValue(),
                Name = value.Name,
                Value = MappingHelpers.ParsePropertyValue(value.Type, value.Value)
            });
        }
        public ClientProperty ApiToDomain(Api.ClientProperty value)
        {
            if (value == null)
            {
                return(null);
            }

            var type = value.Type.ToPropertyType();

            return(new ClientProperty
            {
                Id = value.Id,
                ClientPropertyId = value.ClientPropertyId,
                Type = type,
                ClientId = value.ClientId,
                Name = value.Name,
                Value = MappingHelpers.ParsePropertyValue(type, value.Value)
            });
        }
        public SupplierPropertyValue ApiToDomain(Api.SupplierPropertyValue value)
        {
            if (value == null)
            {
                return(null);
            }

            var type = value.Type.ToPropertyType();

            return(new SupplierPropertyValue
            {
                Id = int.Parse(value.Id),
                SupplierId = int.Parse(value.SupplierId),
                SupplierPropertyId = int.Parse(value.SupplierPropertyId),
                Type = type,
                Name = value.Name,
                Value = MappingHelpers.ParsePropertyValue(type, value.Value)
            });
        }
예제 #5
0
        public ArticleProperty ApiToDomain(Api.ArticleProperty value)
        {
            if (value == null)
            {
                return(null);
            }

            var type = value.Type.ToPropertyType();

            return(new ArticleProperty
            {
                Id = value.Id,
                ArticlePropertyId = value.ArticlePropertyId,
                Type = type,
                ArticleId = value.ArticleId,
                Name = value.Name,
                Value = MappingHelpers.ParsePropertyValue(type, value.Value)
            });
        }