public override string Execute(IList <string> parameters) { List <IMaterial> materials = base.dbctx.Materials; var result = new StringBuilder(); foreach (var material in materials) { result.AppendLine(MaterialService.AsString(material)); } return(result.ToString()); }
public override string Execute(IList <string> parameters) { int materialId; try { materialId = int.Parse(parameters[0]); } catch { throw new ArgumentException("Failed to parse ShowMaterial command parameters."); } IMaterial material = base.dbctx.Materials[materialId]; string result = MaterialService.AsString(material); return(result); }