示例#1
0
 public void SetId(CompanyId id)
 {
     if (Id.Value != 0)
     {
         throw new InvalidOperationException("Id is already set");
     }
     Id = id;
 }
示例#2
0
 public bool Equals(CompanyId other)
 {
     return(Value == other.Value);
 }
示例#3
0
文件: User.cs 项目: Bubelks/Bubelsoft
 public bool CanManageWorkers(CompanyId companyId)
 => companyId == CompanyId &&
 (CompanyRole == UserCompanyRole.Admin || CompanyRole == UserCompanyRole.UserAdmin);
示例#4
0
文件: User.cs 项目: Bubelks/Bubelsoft
 public bool CanEdit(CompanyId companyId)
 => companyId == CompanyId &&
 CompanyRole == UserCompanyRole.Admin;
示例#5
0
文件: User.cs 项目: Bubelks/Bubelsoft
 public void From(CompanyId companyId)
 => CompanyId = companyId;
示例#6
0
 public Company(CompanyId id, string name, string number)
     : this(name, number)
 {
     Id = id;
 }