Пример #1
0
        public async Task <HttpResponseMessage> PostSetData(SetDataSaveRequest setData)
        {
            await _dataRepository.SaveSetData(new SetData
            {
                SetId   = setData.SetId,
                ModelId = setData.ModelId,
                Items   = setData?.Items.Select(i => new SetDataItem
                {
                    Value = i.Value,
                    Name  = i.Name,
                })
            });

            return(Request.CreateResponse(HttpStatusCode.OK));
        }
Пример #2
0
 public async Task<HttpResponseMessage> PostSetData(SetDataSaveRequest setData)
 {
     await _modelRepository.SaveSetData(new SetData
     {
         SetId = setData.SetId,
         ModelId = setData.ModelId,
         Items = setData.Items.Select(i => new SetDataItem
         {
             Value = i.Value,
             Name = i.Name,
             Color = i.Color,
             GroupId = i.GroupId,
         }),
         Groups = setData.Groups?.Select(g => new SetDataGroup
         {
             Id = g.Id,
             Name = g.Name,
         })
     });
     return Request.CreateResponse(HttpStatusCode.OK);
 }
Пример #3
0
        public async Task <HttpResponseMessage> PostSetData(SetDataSaveRequest setData)
        {
            await _modelRepository.SaveSetData(new SetData
            {
                SetId   = setData.SetId,
                ModelId = setData.ModelId,
                Items   = setData.Items.Select(i => new SetDataItem
                {
                    Value   = i.Value,
                    Name    = i.Name,
                    Color   = i.Color,
                    GroupId = i.GroupId,
                }),
                Groups = setData.Groups?.Select(g => new SetDataGroup
                {
                    Id   = g.Id,
                    Name = g.Name,
                })
            });

            return(Request.CreateResponse(HttpStatusCode.OK));
        }