How to generate model from MS SQL with fields and NOT properties. Using EF

54 Views Asked by At

I'm using (EF Core power tools -> Reverse enginiring) to generate classes from MS SQL database.

It generates properties like:

public string Password { get; set; }
public string PositionId { get; set; }

But I need it to be fields like:

public string Password;
public string PositionId;

Is there a way to do so? Will it affect the data manipulating ways?

I need it to be fields becouse Unity's JSONUtility only work with fields and not properties. And since my model should be the same at the server and at the client.

1

There are 1 best solutions below

0
Andrew Production On BEST ANSWER

So yeah. I looked at the problem in the wrong angle.

Using Newtonsoft.Json instead of the Unity's JsonUtility solve the problem.