Exemplo n.º 1
0
 public Task <IActionResult> CommitOrderFor(SneakerProduct product)
 {
     if (product is null)
     {
         throw new ArgumentException(nameof(product));
     }
     return(CommitOrder(product.ReferenceID, product.UniqueID));
 }
Exemplo n.º 2
0
 public PutSneakerImagesRequest(SneakerProduct sneakerProduct) : base("/{sneakerId}/images", Method.PUT)
 {
     AddParameter("sneakerId", sneakerProduct.UniqueID, ParameterType.UrlSegment);
     AlwaysMultipartFormData = true;
     foreach (var photo in sneakerProduct.Photos)
     {
         AddFile(Path.GetFileName(photo), photo);
     }
 }
Exemplo n.º 3
0
 public static Proto.SneakerProduct FromNative(this SneakerProduct native)
 {
     return(new Proto.SneakerProduct
     {
         UniqueId = native.UniqueID,
         ReferenceId = native.ReferenceID,
         BrandName = native.BrandName,
         ModelName = native.ModelName,
         ModelSKU = native.ModelSKU,
         Description = native.Description,
         Color = native.Color,
         Price = Convert.ToDouble(native.Price),
         Type = native.Type.GetEnumMemberValue(),
         AddedAt = native.AddedAt.ToTimestamp(),
         Size = native.Size.FromNative(),
         Condition = native.Condition.GetEnumMemberValue(),
         ConditionIndex = Convert.ToDouble(native.ConditionIndex),
         Owner = native.Owner,
     });
 }
Exemplo n.º 4
0
 public DeleteSneakerProductRequest(SneakerProduct sneakerProduct) : this(sneakerProduct.UniqueID)
 {
 }
Exemplo n.º 5
0
 public static SneakerProductViewModel ToViewModel(this SneakerProduct entity) =>
 entity.CastExtend <SneakerProduct, SneakerProductViewModel>();
 public PostSneakerProductRequest(SneakerProduct sneakerProduct) : base(string.Empty, Method.POST)
 {
     AddJsonBody(sneakerProduct);
 }