public HttpResponseMessage PostRegionCollection(APISignedRequest request)
        {
            CompetitionModel comp;
            var regionCollection            = GetRequestParameter <API_RegionCollection>(request, out comp);
            List <RegionModel> savedRegions = new List <RegionModel>();

            foreach (var arm in regionCollection.Data)
            {
                savedRegions.Add(SaveOneRegion(arm, comp));
            }
            db.SaveChanges();
            API_RegionCollection res = new API_RegionCollection {
                Data = savedRegions.Select(r => r.ToApi()).ToArray()
            };

            return(Request.CreateResponse <API_RegionCollection>(HttpStatusCode.Created, res));
        }
예제 #2
0
 public AsyncRequestResult BeginPostRegionCollection(API_RegionCollection regions, RequestCompleted <API_RegionCollection> callback, Object asyncState)
 {
     return(BeginPostSerializableT("Calendar", "PostTeamCollection", String.Empty, regions, callback, asyncState, true));
 }
예제 #3
0
 public API_RegionCollection PostRegionCollection(API_RegionCollection regions)
 {
     return(PostSerializableT("Calendar", "PostTeamCollection", String.Empty, regions));
 }