public void Create(DetailTypeViewModel model) { var detailTypeModel = new DetailTypeModel { Type = model.Type, Details = model.Details?.Select(x => new DetailModel { Price = x.Price, CarId = x.CarId, ManufacturerId = x.ManufacturerId, TypeId = x.TypeId }).ToList() }; detailTypeService.Create(detailTypeModel); }