0

I have generated a model with Kentico.Kontent.ModelGenerator 6.0.1:

public partial class Car
{
        [JsonProperty("about_image")]
        public IEnumerable<AssetIdentifier> AboutImage { get; set; }
        [JsonProperty("about_text")]
        public string AboutText { get; set; }
        [JsonProperty("additional_header_image")]
}

while compiling getting ERROR :

Error CS0246 The type or namespace name 'AssetIdentifier' could not be found (are you missing a using directive or an assembly reference?)

PS: I'm using the latest Kentico.Kontent.Management 3.0.1

Simply007
  • 444
  • 3
  • 14

3 Answers3

2

There has been a major release of Genereators SDK. You can try regenerating your models with the latest version.

Sevitas
  • 36
  • 3
  • 1
    Thank you @Sevitas ! I used latest beta version of code generator. It is generationg properly models for Management Api 3.1.0. – Anvarjon Ruziev Apr 22 '22 at 05:31
0

It seems that the AssetIdentifier has been removed and the code generator has not been updated yet.

As a workaround, it might be possible to manually replace the occurrences with Kentico.Kontent.Management.Models.Shared.Reference.

I recommend filing an issue against the kontent-generators-net repo.

rocky
  • 7,506
  • 3
  • 33
  • 48
0

The generator adapted for the new major version of the .NET SDK (3.0.0) is currently in beta - Can you try to regenerate models using 7.0.0-beta4 version?

https://www.nuget.org/packages/Kentico.Kontent.ModelGenerator/7.0.0-beta4

There are still two PRs in the queue before releasing the final version:

Simply007
  • 444
  • 3
  • 14