<cite>ismcagdas: </cite> Hi @tteoh,
Can you share the code which causes problem for you ? And also the data you have retrieved you don't want to.
Thanks.
Hi, as I mentioned before I'm wondering why the related data is showing even I'm not using Include method
Entity class:
[Table("AppOrganizationChart")]
public class OrganizationChart : Entity<long>
{
public string Name { get; set; }
public long? ParentId { get; set; }
public string Relationship { get; set; }
public int TitleId { get; set; }
[ForeignKey("TitleId")]
public virtual Title Title { get; set; }
}
Code of getting data:
return await _organizationChartRepository
.GetAll()
.ToListAsync();
Output (I get this from swagger):
[
{
"name": "string",
"parentId": 0,
"relationship": "string",
"titleId": 0,
"title": {
"titleName": "string",
"className": "string"
}
}
]
Thanks. /Tommy
I've one problem about the .Include() here.
The data of the relationship is showed even there is not .Include() extension method. May I know why is this happening? Is it because of the relationship that I created on Entity?
[Table("AppOrganizationChart")]
public class OrganizationChart : Entity<long>
{
public string Name { get; set; }
public long? ParentId { get; set; }
public string Relationship { get; set; }
public int TitleId { get; set; }
[ForeignKey("TitleId")]
public virtual Title Title { get; set; }
}
Thanks. /Tommy
<cite>alper: </cite> You can use SeedHelper class
\MyCompanyName.AbpZeroTemplate.EntityFrameworkCore\Migrations\Seed\SeedHelper.cs
I'm using ASP.NET MVC 5.x & Angularjs 1.x, not ASP.NET Core
<cite>alper: </cite> hi
The solution is simple; When you override OnModelCreating you have to run base onmodelcreating method as well. Otherwise you miss the framework migrations.
Basically your code needs to be shaped like this;
protected override void OnModelCreating(DbModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<OrganizationChart>() .HasRequired(o => o.User) .WithOptional(u => u.OrganizationChart) .Map(m => m.MapKey("UserId")); }
Can you explain more about this?
Thanks. /Tommy
Thank you! It solved.
But I've another question now, which is how to assign a value to the UserId in seed? Because I can't find UserId property when I trying to create a seed.
Thanks. /Tommy
Thank you for your reply.
I just tried with other tables and the outputs are the same.
Thanks. /Tommy
Thank you for your acknowledgement.
But could your please explain more about how does it affects the return result to third party apps in the context of ABP framework?
Thanks. /Tommy
<cite>ismcagdas: </cite> Hi,
AppBunddleConfig is for admin part and FrontendBundleConfig is for public website. CommonBundleConfig is for common script & styles used in both parts.
So, you can add it to one of them according to your needs.
Thanks.
Now I understood what's going on. Thank you
Thanks. /Tommy
<cite>alper: </cite> ...... And while you are debugging css files ......
What do you mean by debugging here? Because I can't replicate what you said. I'm using the web compiler to compile .LESS file but there is only .css file and min.css file. And I got one more question, which is how does the system knows whether to use .css file or min.css file since both of them are compiled by the web compiler?
I still don't know how the .css.map file is being created.