Question: I have two tables: Sentence and FollowUp. 

Sentence simply stores string sentences and a few metadata columns.
FollowUp saves which sentences are followed up by certain other sentences. So, in my followUp table, I reference two sentenceIds (sentenceFrom, sentenceTo). 

My question: Is the relationship between these two tables 1:n or n:m?

My explanation would be the following:
1 line out of Sentence has mostly two references in FollowUp (one sentenceTo, one sentenceFrom).
1 line out of FollowUp also references more than one line in Sentence.

So n:m right, but what intermediate-table should I use between those two?

Answer: 
Try something like this

```
   class Program
    {

        static void Main(string[] args)
        {
            int CURRENT_TIMESTAMP = 123;

            List<CONFIGURATION_LOG> logs = new List<CONFIGURATION_LOG>();
            var results = logs.Where(x => (x.APP_ID == 173) && (x.ROW_LST_UPD_TS >= CURRENT_TIMESTAMP - 7))
                .OrderByDescending(x => x.ROW_LST_UPD_TS)
                .GroupBy(x => x.SETTING_NAME)
                .Select(x => x.FirstOrDefault())
                .Select(x => new
                {
                    setting_name = x.SETTING_NAME,
                    setting_value = x.SETTING_VALUE,
                    row_lst_upd_ts = x.ROW_LST_UPD_TS,
                    machine_name = x.MACHINE_NAME,
                    row_lst_upd_uid = x.ROW_LST_UPD_UID
                }).ToList();

        }
    }
    public class EVENT_MGT
    {
        CONFIGURATION_LOG CONFIGURATION_LOG { get; set; } 
    }
    public class CONFIGURATION_LOG
    {
        public string SETTING_NAME { get; set; }
        public string SETTING_VALUE { get; set; }
        public int ROW_LST_UPD_TS { get; set; }
        public string MACHINE_NAME { get; set; }
        public string ROW_LST_UPD_UID { get; set; }
        public int APP_ID { get; set; }
    }

```
Thanks to jdweng, I figured out how to get exactly what I need:

```
var results = config_log.Where(x => x.AppId == 173)
                                    .OrderByDescending(x => x.RowLstUpdTs).ToList()
                                    .GroupBy(x => x.SettingName )
                                    .Select(x => new
                                    { 
                                        setting_name = x.Select(y => y.SettingName).FirstOrDefault(),
                                        setting_value = x.Select(y => y.SettingValue).FirstOrDefault(),
                                        row_lst_upd_ts = x.Select(y => y.RowLstUpdTs).FirstOrDefault(),
                                        machine_name =  x.Select(y => y.MachineName).FirstOrDefault(),
                                        row_lst_upd_uid = x.Select(y => y.RowLstUpdUid).FirstOrDefault()
                                    }).ToList();

```