예제 #1
0
 /// <summary>
 /// Initializes a new instance of the GruntCommand class.
 /// </summary>
 public GruntCommand(string command, System.DateTime commandTime, int commandOutputId, string userId, int?id = default(int?), CommandOutput commandOutput = default(CommandOutput), CovenantUser user = default(CovenantUser), int?gruntTaskingId = default(int?), GruntTasking gruntTasking = default(GruntTasking), int?gruntId = default(int?))
 {
     Id              = id;
     Command         = command;
     CommandTime     = commandTime;
     CommandOutputId = commandOutputId;
     CommandOutput   = commandOutput;
     UserId          = userId;
     User            = user;
     GruntTaskingId  = gruntTaskingId;
     GruntTasking    = gruntTasking;
     GruntId         = gruntId;
     CustomInit();
 }
예제 #2
0
 /// <summary>
 /// Validate the object.
 /// </summary>
 /// <exception cref="ValidationException">
 /// Thrown if validation fails
 /// </exception>
 public virtual void Validate()
 {
     if (Command == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "Command");
     }
     if (UserId == null)
     {
         throw new ValidationException(ValidationRules.CannotBeNull, "UserId");
     }
     if (CommandOutput != null)
     {
         CommandOutput.Validate();
     }
     if (GruntTasking != null)
     {
         GruntTasking.Validate();
     }
 }