0

Can LLBLGEN return a dictionary, where each key is the primary key a row, and each value is an object representing the data of a row. For example

var customers = new EntityCollection<CustomerWebSalesSummaryEntity>();
            using (var adapter = new DataAccessAdapter(config.ProductionConnectionString))
            {

                adapter.FetchEntityCollection(customers, null);
            }

My understanding is that customers is a list. I would like it to be a dictionary, where each key is the primary key of a customer row, and each value is an object representing the data of a customer row. I know that I can convert the list to a dictionary, but I was wondering if LLBLGEN had the option of returning one from the outset.

JRG
  • 210
  • 1
  • 10
  • Does https://www.llblgen.com/documentation/5.1/LLBLGen%20Pro%20RTF/Using%20the%20generated%20code/Adapter/gencode_usingcollectionclasses_adapter.htm help? – mjwills Aug 09 '17 at 07:44
  • Hi, it doesn't help. I had already read that page before posting this question. The only thing in there that could remotely relate to my question is the section about "Hierarchical projections of entity collections". Skimming though it, it doesn't appear to give me what I want. – JRG Aug 09 '17 at 07:50
  • 1
    It's not a list, it's an entityCollection. Just use LINQ .ToDictionary().. It will do what you need. – tkit Oct 22 '17 at 16:12
  • The short answer is No, LLBLGen returns an EntityCollection where T is a strongly typed object. – kooch May 20 '20 at 18:00

0 Answers0