Пример #1
0
        public IHttpActionResult PutMatches(MatchModel model, string endPoint, string timestamp)
        {
            if (model.IsNotValid())
            {
                return(BadRequest());
            }
            var server = _serverRepository.GetByEndPointWithInclude(endPoint);

            if (server == null)
            {
                return(BadRequest());
            }
            model.Date   = DateTime.Parse(timestamp);
            model.Server = server;


            if (!_matchService.TryInsert(model))
            {
                return(BadRequest());
            }

            return(Ok());
        }