Specification icon indicating copy to clipboard operation
Specification copied to clipboard

Cannot save data with Backing Field

Open datnt97 opened this issue 8 months ago • 0 comments

I cannot save data for the class MyEntityNotWork because the Backing Field is not the camel case of the field. For the class MyEntity, it's working.

Did I do anything wrong?

public class MyEntityNotWork
{
  public string Data
  {
    get => IsCompressed ? _dataTest.Decompress() : _dataTest;
    private set => _dataTest = value;
  }

  public string StyleData
  {
    get => IsCompressed ? _styleTest.Decompress() : _styleTest;
    private set => _styleTest = value;
  }

  public string Config
  {
    get => IsCompressed ? _configTest.Decompress() : _configTest;
    private set => _configTest = value;
  }
}
public class MyEntity
{
  public string Data
  {
    get => IsCompressed ? _data.Decompress() : _data;
    private set => _data = value;
  }

  public string StyleData
  {
    get => IsCompressed ? _styleData.Decompress() : _styleData;
    private set => _styleData = value;
  }

  public string Config
  {
    get => IsCompressed ? _config.Decompress() : _config;
    private set => _config = value;
  }
}

datnt97 avatar Jun 03 '24 05:06 datnt97