public string ProcessRequest(Request request) { if (Context.Users.ContainsKey(request.UserName)) return Context.RegisterResultMessages["Fail"]; Context.Users.Add(request.UserName, request.Password); return Context.RegisterResultMessages["Ok"]; }
private static Request BuildRequest(string[] line) { var command = GetRequestCommand(line[0]); var request = new Request() { Command = command, UserName = line[1] }; if (command != Command.logout) { request.Password = line[2]; } return request; }
public static string PrecessReqest(Request request) { return strategies[request.Command].ProcessRequest(request); }