| PUT | /equipment/{Id} |
|---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using tvpl.api.ServiceModel;
using tvpl.data.Models;
namespace tvpl.api.ServiceModel
{
public partial class UpdateEquipmentRequest
{
public virtual int Id { get; set; }
public virtual string Name { get; set; }
public virtual string ImageUrl { get; set; }
public virtual string Description { get; set; }
public virtual string Unit { get; set; }
public virtual int? MaterialTypeId { get; set; }
}
}
namespace tvpl.data.Models
{
public partial class Equipment
{
public virtual int Id { get; set; }
[Required]
[StringLength(500)]
public virtual string Name { get; set; }
[StringLength(1000)]
public virtual string ImageUrl { get; set; }
public virtual string Description { get; set; }
[StringLength(50)]
public virtual string Unit { get; set; }
public virtual int? MaterialTypeId { get; set; }
public virtual int Status { get; set; }
public virtual bool? IsDeleted { get; set; }
public virtual DateTime? ApprovedAt { get; set; }
public virtual int? ApprovedBy { get; set; }
public virtual DateTime? CreatedAt { get; set; }
public virtual int? CreatedBy { get; set; }
public virtual DateTime? UpdatedAt { get; set; }
public virtual int? UpdatedBy { get; set; }
[Ignore]
public virtual string MaterialTypeName { get; set; }
[Ignore]
public virtual string CreatedByName { get; set; }
[Ignore]
public virtual string ApprovedByName { get; set; }
}
}
C# UpdateEquipmentRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
PUT /equipment/{Id} HTTP/1.1
Host: etc-api.vsmlab.vn
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: 0,
name: String,
imageUrl: String,
description: String,
unit: String,
materialTypeId: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
id: 0,
name: String,
imageUrl: String,
description: String,
unit: String,
materialTypeId: 0,
status: 0,
isDeleted: False,
approvedAt: "0001-01-01T00:00:00.0000000+07:06",
approvedBy: 0,
createdAt: "0001-01-01T00:00:00.0000000+07:06",
createdBy: 0,
updatedAt: "0001-01-01T00:00:00.0000000+07:06",
updatedBy: 0,
materialTypeName: String,
createdByName: String,
approvedByName: String
}