Click here to Skip to main content
15,566,064 members
Home / Discussions / C#
   

C#

 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 10:53
professionalEddy Vluggen9-Mar-20 10:53 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 9:58
professionalEddy Vluggen9-Mar-20 9:58 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 5:14
professionalEddy Vluggen9-Mar-20 5:14 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 10:09
Exoskeletor9-Mar-20 10:09 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 10:15
professionalEddy Vluggen9-Mar-20 10:15 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 10:31
Exoskeletor9-Mar-20 10:31 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 10:49
professionalEddy Vluggen9-Mar-20 10:49 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 15:18
Exoskeletor9-Mar-20 15:18 
Great friend, with your help im executing a transaction and if it is completed i save this state somewhere. and to check if db exist and not to recreated i have made this code that works great,im also saving the current database version as int in order to easily do more updates in the future.
Now all i have to do is call GetTemplateById or GetAllTemplates and if any creation is required will happen Smile | :) Smile | :)

public bool FirstRun { get; set; } = true;
public int DatabaseCreatedVersionOf { get; set; } = -1;

public override void OnCreate()
{
    base.OnCreate();
}

public void UpdateDatabaseCreatedVersion()
{
    DatabaseCreatedVersionOf = Preferences.Get(Settings.DatabaseCreatedVersionOfKey,
       Settings.DatabaseCreatedVersionOfDefault);
}

public void CreateTemplateDB()
{
    UpdateDatabaseCreatedVersion();
    if (DatabaseCreatedVersionOf == -1)
        TemplateDB.CreateDB();
    FirstRun = false;
}
public Template GetTemplateById(int id)
{
    if (FirstRun)
    {
        CreateTemplateDB();
        FirstRun = false;
    }

    return TemplateDB.GetTemplate(id);
}
public List<Template> GetAllTemplates()
{
    if (FirstRun)
    {
        CreateTemplateDB();
        FirstRun = false;
    }

    return TemplateDB.GetAllTemplates();
}

PraiseRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen10-Mar-20 2:44
professionalEddy Vluggen10-Mar-20 2:44 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Eddy Vluggen9-Mar-20 3:23
professionalEddy Vluggen9-Mar-20 3:23 
GeneralRe: Converting List<int> to List<object> for One to Many relation with sqlite-net-extensions Pin
Exoskeletor9-Mar-20 1:26
Exoskeletor9-Mar-20 1:26 
QuestionHow do I make table data red in <td>? Pin
Member 114033044-Mar-20 9:33
Member 114033044-Mar-20 9:33 
AnswerRe: How do I make table data red in <td>? Pin
Richard Deeming4-Mar-20 9:50
mveRichard Deeming4-Mar-20 9:50 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033044-Mar-20 9:59
Member 114033044-Mar-20 9:59 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming5-Mar-20 0:58
mveRichard Deeming5-Mar-20 0:58 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 5:36
Member 114033049-Mar-20 5:36 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming9-Mar-20 9:36
mveRichard Deeming9-Mar-20 9:36 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 10:41
Member 114033049-Mar-20 10:41 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming9-Mar-20 10:53
mveRichard Deeming9-Mar-20 10:53 
GeneralRe: How do I make table data red in <td>? Pin
Member 114033049-Mar-20 12:45
Member 114033049-Mar-20 12:45 
GeneralRe: How do I make table data red in <td>? Pin
Richard Deeming10-Mar-20 1:14
mveRichard Deeming10-Mar-20 1:14 
GeneralRe: How do I make table data red in <td>? Pin
Member 1140330412-Mar-20 5:08
Member 1140330412-Mar-20 5:08 
QuestionHow to capture credentials / auth token from Windows credential popup dialog? Pin
S p k 5214-Mar-20 1:27
S p k 5214-Mar-20 1:27 
AnswerRe: How to capture credentials / auth token from Windows credential popup dialog? Pin
Richard MacCutchan4-Mar-20 1:37
mveRichard MacCutchan4-Mar-20 1:37 
GeneralRe: How to capture credentials / auth token from Windows credential popup dialog? Pin
S p k 5214-Mar-20 3:03
S p k 5214-Mar-20 3:03 

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.