Coder Social home page Coder Social logo

Comments (2)

paulyoder avatar paulyoder commented on July 21, 2024

For this situation you will have to have separate instance of the ExcelQueryFactory.

An easy workaround for the transformations needed for the relationships is to select the data from each spreadsheet and convert it to a list before you do a transformation

var instance1 = new ExcelQueryFactory("worksheetFile");
instance1.AddMapping<Type1>(x => x.IdentificationName, "Type1 Identification Name");
var data1 = (from row in instance1.Worksheet<Type1>()
                  select row).ToList();

var instance2 = new ExcelQueryFactory("worksheetFile");
instance2.AddMapping<Type2>(x => x.IdentificationName, "Type2 Identification Name");
var data2 = (from row in instance2.Worksheet<Type1>()
                  select row).ToList();

Now that these are 2 in memory lists, you should have no problem with the transformation

from linqtoexcel.

paqogomez avatar paqogomez commented on July 21, 2024

Yes, my issue might have been better explained with these examples.

    instance.AddMapping<Type1>(x => x.IdentificationName, "Type1 Identification Name", x=> CreateType1WithType2(x));
    instance.AddMapping<Type2>(x => x.IdentificationName, "Type2 Identification Name");

This structure however was extremely slow with the recursive nature of my problem. Pulling the data out into lists as you suggest above and transforming in memory was a much better solution. Thanks!

from linqtoexcel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.