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

一对一多字段关联 #1930

Open
gudufy opened this issue Nov 23, 2024 · 4 comments
Open

一对一多字段关联 #1930

gudufy opened this issue Nov 23, 2024 · 4 comments

Comments

@gudufy
Copy link

gudufy commented Nov 23, 2024

使用场景

比如我有个SEO表文章分类都要用到,我希望通过id和类型来关联,在freesql里该怎么做
@2881099
Copy link
Collaborator

2881099 commented Nov 23, 2024

List 设置关联字段

@gudufy
Copy link
Author

gudufy commented Nov 24, 2024

List 设置关联字段

比如下面的类我该如何完善呢?

public class Article {
     public long Id {get; set;}
     public Seo Seo  {get;set;}
}
public class Category{
     public long Id {get; set;}
     public Seo Seo  {get;set;}
}
public class Seo {
    public long id {get;set;}
}

@2881099
Copy link
Collaborator

2881099 commented Nov 24, 2024

public class Article {
     public long Id {get; set;}
     public long SeoId {get; set;}
     public Seo Seo  {get;set;}
}
public class Category{
     public long Id {get; set;}
     public long SeoId {get; set;}
     public Seo Seo  {get;set;}
}
public class Seo {
    public long id {get;set;}
}

@gudufy
Copy link
Author

gudufy commented Dec 11, 2024

这个没法级联保存吗?需要分开写保存代码?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants