EntityFrameworkCore.Generator icon indicating copy to clipboard operation
EntityFrameworkCore.Generator copied to clipboard

Closes #549 Add option to generate a PK guid value in the entity class

Open ArnaudB88 opened this issue 11 months ago • 0 comments

Resolves #549 Add an option to generate a new Guid value for the primary key property in the generated entity classes.

YAML usage:

data:
  entity:
    generatePkValue: true

Code generation result:

using System;
using System.Collections.Generic;

namespace Company.Project.Domain.Entities;

public partial class Project
{
    public Project()
    {
        #region Generated Constructor
        Id = Guid.NewGuid();
        #endregion
    }

    #region Generated Properties
    public Guid Id { get; set; }
    #endregion
}

ArnaudB88 avatar Mar 22 '24 11:03 ArnaudB88