Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Association truble #24

Closed
genusP opened this issue Jul 18, 2013 · 4 comments
Closed

Association truble #24

genusP opened this issue Jul 18, 2013 · 4 comments

Comments

@genusP
Copy link
Contributor

genusP commented Jul 18, 2013

If association property used in select clause, query crash.

Query:

var db = new DataConnection();
var res = 
    from o in db.GetTable<Organization>() 
    where o.Id == 1 
    select new Class1<Organization, IEnumerable<Employee>>() { obj = o, Expand = o.EmployesToOrganizations };
var arr = res.ToArray();

Object model.

public class Organization
{
  [PrimaryKey, Identity ] 
  public int    Id  { get; set; } 

  [Column, Nullable] 
  public string Name { get; set; }

  [Association(ThisKey="Id", OtherKey="Organization_Id", CanBeNull=false)]
  public IEnumerable<Employee> EmployesToOrganizations { set; set; }
}
public class Employee
{
  [PrimaryKey, Identity ] 
  public int    Id  { get; set; } 

  [Column]
  public string FIO { get; set; }

  [Column, NotNull]
  public int Organization_Id { get; set; }
}
class Class1<T, TExpand>
    {
        public T obj { get; set; }
        public TExpand Expand { get; set; }
    }
@igor-tkachev
Copy link
Member

Multiple queries are not supported yet.

@genusP
Copy link
Contributor Author

genusP commented Jul 25, 2013

Support are planed ?

@igor-tkachev
Copy link
Member

Yes.

@genusP
Copy link
Contributor Author

genusP commented Sep 16, 2013

Not work in 1.0.1

@genusP genusP mentioned this issue Oct 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants