How to represent Guid in typescript?

后端 未结 3 721
Happy的楠姐
Happy的楠姐 2020-12-15 20:55

let\'s say I have this C# class

public class Product
{
   public Guid Id { get; set; }
   public string ProductName { get; set; }
   public Decimal Price { g         


        
3条回答
  •  醉梦人生
    2020-12-15 21:33

    Another alternative is using following NPM package:

    guid-typescript which you can find here: https://www.npmjs.com/package/guid-typescript

    Then it will be just like this:

    import { Guid } from "guid-typescript";
    
    export class Product {
        id: Guid;
        productName: string;
        price: number;
        level: number;
    }
    

提交回复
热议问题