:headphones: A NoSQL C#/.NET RethinkDB database driver with 100% ReQL API coverage.
### Version Information | Software | Version(s) | | ------------------------| ---------- | | NuGet Package | 2.3.23 | | .NET Core? | 2.2 | | RethinkDB Server | 2.3.6-windows / 6.1.7601 | | Server Windows OS? |2008 R2 | ### What is the expected behavior? Following client-side primary key generation guide, we should use non-public constructor to implement id generation. This is best way, but Insert().RunAtom<Type>() returns a object with regenerated uuid, even if another ctor with another public ctor with JsonConstructor attribute is defined. ### What is the actual behavior? Object should be generated without calling a constructor (idk, may it should be in config)? ### Any possible solutions? no ### How do you reproduce the issue? ```csharp public class State { [JsonProperty("id", DefaultValueHandling = DefaultValueHandling.Ignore)] public string Id { get; set; } public string someProperty {get; set;} protected State() { this.Id = Guid.NewGuid().ToString(); } [JsonConstructor] public State(string someProperty) { } ... var state = new State(); table.Insert(state).RunAtom<State>(conn).Id != state.Id; // true ``` ### Do you have a unit test that can demonstrate the bug? no. ### Can you identify the location in the driver source code where the problem exists? I suppose: Connection.cs, line 300-305 ```csharp protected virtual async Task<T> RunQueryAtomAsync<T>(Query query, CancellationToken cancelToken) { //query. var res = await SendQuery(query, cancelToken, awaitResponse: true).ConfigureAwait(false); if( res.IsAtom ) { try { if( typeof(T).IsJToken() ) { if( res.Data[0].Type == JTokenType.Null ) return (T)(object)null; var fmt = FormatOptions.FromOptArgs(query.GlobalOptions); Converter.ConvertPseudoTypes(res.Data[0], fmt); return (T)(object)res.Data[0]; //ugh ugly. find a better way to do this. //return res.Data[0].ToObject<T>(); } return res.Data[0].ToObject<T>(Converter.Serializer); } catch( IndexOutOfRangeException ex ) { throw new ReqlDriverError("Atom response was empty!", ex); } } if( res.IsError ) { throw res.MakeError(query); } throw new ReqlDriverError( $"The query response cannot be converted to an object of T or List<T>. This run helper works with SUCCESS_ATOM results. The server response was {res.Type}. If the server response can be handled by this run method try converting to T or List<T>. Otherwise, if the server response cannot be handled by this run helper use another run helper like `.RunCursor` or `.RunResult<T>`."); } ``` ### If the bug is confirmed, would you be willing to submit a PR? Yes Sorry for my English.
This issue appears to be discussing a feature request or bug report related to the repository. Based on the content, it seems to be resolved. The issue was opened by MrFoxPro and has received 4 comments.