Select of string value bombs out
See original GitHub issueMy Data Model
public class FrameworkUserConfiguration
{
//used to store object in sqlite database
public Guid FrameworkUserUid { get; set; }
public byte[] Picture { get; set; }
public DateTime LastUpdate { get; set; }
public FrameworkUserDataType Type { get; set; }
public string Description { get; set; }
public string AudioFile { get; set; }
public bool? RepeatAudio { get; set; }
public bool ContainsPicture { get; set; }
[SQLite.PrimaryKey]
public string Identifier
{
get
{
return FrameworkUserUid.ToString() + "-" + Type;
}
set
{
}
}
}
public enum FrameworkUserDataType
{
ActualUser,
Admin,
User
}
A simple select bombs out telling me there’s no parameterless constructor (after filling the table with some random data entries)
List<string> guids = conn.Table<FrameworkUserConfiguration>().Select(x => x.Identifier).ToList();
At first glance this appears to be an issue because public IEnumerator<T> GetEnumerator () is called for T being System.String - so it then creates a dummy table mapping and once we get to
var obj = Activator.CreateInstance(map.MappedType);
things go wrong because System.String has no parameterless constructor.
Issue Analytics
- State:
- Created 11 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
How to get a value from Select-String
What i'm trying to do is get the value 49,99 in this case. I am able to get the line out of the...
Read more >Query optimization techniques in SQL Server: tips and tricks
In this blog post we will show you step by step some tips and tricks for successful Query optimization techniques in SQL Server....
Read more >given a string, can you access a property (in a class) that ...
I have to build an itermediate object in any case, and I'm just going to add 2 functions to that class: setValue(_ value,...
Read more >Legacy SQL Functions and Operators | BigQuery
Most SELECT statement clauses support functions. ... GROUP BY x" returns one output record for each distinct x value, and contains a repeated...
Read more >Defusing a Binary Bomb 1 Introduction The nefarious Dr. ...
Dr evil binary bomb. c**. A binary bomb is a program that consists of asequence of phases. If you type the correct string,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had added some mthods in SQLite.cs in SQLiteCommand:
in SQLiteConnection:
so you can use it like this:
var singlequery = conn.SingleQuery<string>("select ColumnName from TableName");
Hope for help.@praeclarum is there any reason the code above is not being merged? Are you waiting for a PR? It appears that many people encounter this little problem and there are also a lot of duplicate issues on this, which could also be closed with a small code addition that seems to have no negative side-effects from what I can tell.