private EGMSPermissionRM CreateEGMSPermission(Commands.V1.EGMSPermission.Create cmd) { if (_repository.PermissionExists(cmd.PermissionName)) { throw new InvalidOperationException($"Permission with name {cmd.PermissionName} already exists"); } EGMSPermission permission = EGMSPermission.Create(_permissions++, PermissionName.Create(cmd.PermissionName), PermissionDescription.Create(cmd.PermissionDescription), cmd.IsActive); _repository.AddPermission(permission); return(Conversions.GetEGMSPermissionRM(permission)); }