Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save trevorchunestudy/e736d1e2b5ee9fcd56029e87bccf8712 to your computer and use it in GitHub Desktop.

Select an option

Save trevorchunestudy/e736d1e2b5ee9fcd56029e87bccf8712 to your computer and use it in GitHub Desktop.
Basic DDD entity
using System.ComponentModel.DataAnnotations;
namespace LMS.Core.Domain.Management
{
public class User : Entity
{
private User(string authId)
{
AuthId = authId;
}
//Needed for EF
private User () { }
[MaxLength(100)]
public string AuthId { get; private set; }
public User Create(string authId)
{
return new User(authId);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment