Hi Enisn, I appreciated your answer, but, I could not create an instance for CurrentTenant in the MenuContributor class. Dependency Injection doesn't work on that class and I have no idea how I could create a new instance to check the current TenantId.
Anyway, it seems to be answered by @alper, the right thing is defining the scope in the PermissionDefinitionClass.
Hi Alper.
I haven't found a solution so far. Temporarily, I changed my grid to client-side operations, so, it wlll peform all operation on client side (filter, group, sort).
Hi mladen.macanovic, I did the test again changing the string for the method nameof, but that haven't changing nothing. I think the problem is when parsing the object DataSourceRequest into Json for the method. The method by itself is not called. I guess it would be easier to be reproduced.
Here is my class OutageReportDto:
public class OutageReportDto : AuditedEntityDto<int>, IMultiTenant
{
public Guid? TenantId { get; set; }
public int SupplyNetworkId { get; set; }
public string SupplyNetworkName { get; set; }
public DateTime RecordedTime { get; set; }
public string Location { get; set; }
public string Suburb { get; set; }
public int CauseId { get; set; }
public string CauseName { get; set; }
public string ContactPhoneNumber { get; set; }
public double LatitudeReporter { get; set; }
public double LongitudeReporter { get; set; }
public double LatitudeLocator { get; set; }
public double LongitudeLocator { get; set; }
public DateTime? NotifiedTime { get; set; }
public new DateTime CreationTime { get; set; }
}
Notice, if I change the grid to Client-Side filter, where I just call a service method with no parameters to return a complete List<OutageReporterDto>, it works fine. So, I don't think that there's an issue with my grid or my Dto class. The problem is only when calling the service method with a parameter type DataSourceRequest and there is a Filter item in this object. If there is no filter items the method works fine.
Hi Alper,
So, I need to set the menu scope (Tenant / Host) in the PermissionDefinitionProvider and then it will reflect the menu as well, is that right?
Hi @Alper,
Thank you for your answer. That is a solution, but, it is not dynamic at all. If in future a new field is added to the grid, there will be a need to add a new condition in the switch clause.
AspNetZero implements that extension for EF which makes life easier. I just don't want to implement those extensions and then in the next versions ABP.IO Commercial framework release the same extension, it would be waste of time from my side as a framework client.
I've worked out my issue with this code:
var list = Repository.Join(_networkTypeRepository, A => A.NetworkTypeId, B => B.Id, (supplyNetwork, networkType) => new { supplyNetwork, networkType }).ToList();
var dtos = list.Select(x => {
var dto = ObjectMapper.Map<SupplyNetwork, SupplyNetworkDto>(x.supplyNetwork);
dto.NetworkTypeName = x.networkType.Name;
return dto;
}).AsQueryable().OrderBy(input.Sorting).ToList();
dtos = dtos.Skip(input.SkipCount).Take(input.MaxResultCount).ToList();
It will work because this CRUD will always have few records. But, it seems inefficient when there are too many records because it will bring all record from the database to the server and then perform the pagination stuff (Skip / Take). I have to do that to be able to convert my entity into my dto class and then filter using the Dto fields, including the relationships.
What would be recommended for this scenario?
Hi, thank you for your answer!
I am really sorry, I've research here in the support forum but I forgot to check that on Github issues. The issue is exactly that one, so, I'll need the next release to get that sorted.
About the Blazorise component, that Bar would suit for me. I didn't know the sidebar was obsolete!
Hi,
I am trying to add the Blaorise.SideBar package in the Abp.IO Blazor project, but it is not working. It seems that there is some version conflict.
I am following the steps as this document: https://blazorise.com/docs/extensions/sidebar/
The current version for Blazorise is 0.9.3-preview6. If I try to update that the project fails when initializing.
So, If I install the Blazorise.SideBar version 0.9.2.5 (the previous one before 0.9.3), the project loads but when using the SideBar component it craches.
What would I do to be able to use Blazorise.SideBar?
Hi,
I am creating most of my entities descending from the clas AuditedAggregateRoot. It implements the field CreationTime and LastModificationTime. Using Postgres database and Entity Framework Code First, it is creating those fields as Timestamp without timezone. In my opinion, it should be with timezone instead.
I realized that if a class is defined as DateTime, Npgsql will create that field as "timestamp without timezone". However, if the field is defined as DateTimeOffset, then it creates as "timestamp with timezone".
I think I have basically two options to deal with that:
builder.Entity<Cause>(b => {
b.ToTable("Causes");
b.ConfigureByConvention();
b.Property(x => x.CreationTime).HasColumnType("timestamp with time zone");
b.Property(x => x.LastModificationTime).HasColumnType("timestamp with time zone");
});
public partial class Create_Cause : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Causes",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
TenantId = table.Column<Guid>(type: "uuid", nullable: true),
Name = table.Column<string>(type: "character varying(50)", maxLength: 50, nullable: true),
DefaultCause = table.Column<bool>(type: "boolean", nullable: false),
MarkerColor = table.Column<int>(type: "integer", nullable: false),
MakerType = table.Column<int>(type: "integer", nullable: false),
ExtraProperties = table.Column<string>(type: "text", nullable: true),
ConcurrencyStamp = table.Column<string>(type: "character varying(40)", maxLength: 40, nullable: true),
// Before
// CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
// After
CreationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
CreatorId = table.Column<Guid>(type: "uuid", nullable: true),
// LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: true),
LastModificationTime = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
LastModifierId = table.Column<Guid>(type: "uuid", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Causes", x => x.Id);
});
}
I am not sure if there is other way to do that. Do you think will be a solution in the framework for this issue in future? What is recommended to do at this situation?
Hi,
I have a global system, it will be used in Canada, USA, Australia, and New Zealand, and I am trying to understand how ABP.IO Blazor UI template works with timezone with Entity Framework Core and PostGres database.
I am familiar how Boilerplate works with timezone with AspNetZero MVC .NetCore + JQuery. However, I am struggling to understand how I should implement that in ABP.IO Blazor Template. I have already read this document: https://docs.abp.io/en/abp/latest/Timing
I was wondering if there is some binders and converter for Web API methods similar as implemented by Boilerplate. See this document: https://aspnetboilerplate.com/Pages/Documents/Timing#binders-and-converters
Is there some example how to deal with timezones for Blazor template, in both ways, going from the client to the database and then from the database back to the client?