Click here to Skip to main content
15,180,707 members
Home / Discussions / C#
   

C#

 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor8-Mar-20 15:54
MemberExoskeletor8-Mar-20 15:54 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor8-Mar-20 15:56
MemberExoskeletor8-Mar-20 15:56 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Mycroft Holmes8-Mar-20 16:12
professionalMycroft Holmes8-Mar-20 16:12 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor8-Mar-20 17:02
MemberExoskeletor8-Mar-20 17:02 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen8-Mar-20 22:50
professionalEddy Vluggen8-Mar-20 22:50 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor8-Mar-20 23:36
MemberExoskeletor8-Mar-20 23:36 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen8-Mar-20 23:44
professionalEddy Vluggen8-Mar-20 23:44 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 0:28
MemberExoskeletor9-Mar-20 0:28 
Im not using a blob any more, i follow your suggestion and now i use this:

[Table("Templates")]
public class Template
{
    [PrimaryKey, AutoIncrement]
    public int Id { get; set; }
    public int Category { get; set; }
    //[TextBlob("imagesBlobbed")]
    [OneToMany]
    public List<TemplateImage> TemplateImages { get; set; }
    public int ImagesHash { get; set; }
    //public string imagesBlobbed { get; set; }
}
[Table("TemplateImages")]
public class TemplateImage
{
    [PrimaryKey, AutoIncrement]
    public int Id { get; set; }
    public int Category { get; set; }
    public int Image { get; set; }
    [ForeignKey(typeof(Template))]
    public int TemplateId { get; set; }
}


So the question is, how i can md5 List<templateimage>? (or another consistent hash)

Quote:
You could combine those five queries into one. Something like "SELECT Id FROM TemplateImages WHERE ImageHash IN (@value1, @value2, @value3, @value4, @value5". If the values already exist in the table, such a query would give you their Id's.


why every image to have a hash? what hash will they have? i dont understand,
this is how i can check if one image of the new template im trying to pass, exist on a template from the DB
var result = DatabaseHelper.db().Query<TemplateImage>("Select * from TemplateImages where Image=?", images[0]);


If i can find a single query that can do that for all the images, i think im good

modified 9-Mar-20 6:03am.

GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 1:18
professionalEddy Vluggen9-Mar-20 1:18 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 1:21
MemberExoskeletor9-Mar-20 1:21 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 1:34
professionalEddy Vluggen9-Mar-20 1:34 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 1:39
MemberExoskeletor9-Mar-20 1:39 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 1:59
MemberExoskeletor9-Mar-20 1:59 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 2:01
professionalEddy Vluggen9-Mar-20 2:01 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 2:08
MemberExoskeletor9-Mar-20 2:08 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 2:13
professionalEddy Vluggen9-Mar-20 2:13 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 2:23
MemberExoskeletor9-Mar-20 2:23 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 2:33
MemberExoskeletor9-Mar-20 2:33 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 3:26
professionalEddy Vluggen9-Mar-20 3:26 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 3:38
MemberExoskeletor9-Mar-20 3:38 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 3:41
professionalEddy Vluggen9-Mar-20 3:41 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 4:02
MemberExoskeletor9-Mar-20 4:02 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 4:51
MemberExoskeletor9-Mar-20 4:51 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 5:05
MemberExoskeletor9-Mar-20 5:05 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 5:11
professionalEddy Vluggen9-Mar-20 5:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.