public HttpResponseMessage Join(AudioBattleModel value) { //TODO more validation if its a valid battle that a user can join such as end date Contract.Requires(value != null); var pageUserId = value.PageUserId; this._audioBattle = new RapBattleAudio(value.PageUserId, value.BattleId).GetSettings() as RapBattleAudio; if (this._audioBattle.UserId1 == pageUserId || this._audioBattle.UserId2 == pageUserId || (RapContextFacade.Current.GetUserId() != pageUserId)) { return Request.CreateResponse(HttpStatusCode.BadRequest); } this._audioBattle.JoinBattle(value.PageUserId); return Request.CreateResponse(HttpStatusCode.Created); }
public HttpResponseMessage CreateBattle(AudioBattleModel battle) { throw new NotImplementedException(); }