That's correct. Was that fact reflected in the way you generate the controllers? I assume you still generate controllers dynamically, right?
Thanks Ismail. I will check the link.
When you say, AppServices are considered as controllers in ASP.NET Core. What have been changed from ASP.NET MVC to ASP.NET Core to make AppServices as controllers? Isn't still the controllers dynamically generated in ASP.NET core?
Thanks
Hello In Abp, is there a standard way to intercept AppService or DomainManager so that I run some checking code before running the method?
The concept is similar to ASP. NET filters. I'm wondering if Abp offers a way to define such interceptors.
If not. An ASP. NET filter can be used for AppService methods?
Thanks
Hello @aaron,
I figured out the problem. I had a leftover record with an ID that is not present anymore in the system. Hence, the exception. Thanks for your time.
Hi Ismail,
I am using ASP.NET Core .NET 4.6.
I cannot find the log anywhere. Is there a specific file I should check to make sure of the path? I only checked web.config and the path is correct. The logging before was happening inside bin folder then AppData then Log etc.
Thanks
If you notice in my code that I shared, I am setting myself the RcmCoordinatorId. The other one I get from the client. So yes, I am debugging and I am seeing both ID's with values for existing users in the system.
Thanks
Thanks @aaron for your feedback.
But the RcmMemberId is always filled with a valid value coming from the client. Isn't that what you mean?
Thanks
Hi, For the ASP.NET Core / Angular project (v 4.3.0)
I have an entity that defines 2 properties of type User.
public virtual User RcmMember { get; set; }
public virtual long RcmMemberId { get; set; }
public virtual User RcmCoordinator { get; set; }
public virtual long RcmCoordinatorId { get; set; }
In the DbContext, I have the following:
modelBuilder.Entity<Assignment>().ToTable("Assignments").HasIndex(r => new { r.ReferralId, r.Id }).IsUnique();
modelBuilder.Entity<Assignment>().Property(p => p.AssignmentDate).IsRequired();
modelBuilder.Entity<Assignment>().Property(p => p.TransportationId).IsRequired();
modelBuilder.Entity<Assignment>().Property(p => p.ServiceId).IsRequired();
modelBuilder.Entity<Assignment>().Property(p => p.State).IsRequired();
modelBuilder.Entity<Assignment>().Property(p => p.Comments).HasMaxLength(550);
modelBuilder.Entity<Assignment>().Property(p => p.RcmMemberComments).HasMaxLength(550);
modelBuilder.Entity<Assignment>().Property(p => p.RcmCoordinatorComments).HasMaxLength(550);
modelBuilder.Entity<Assignment>()
.HasOne(e => e.RcmCoordinator)
.WithMany()
.HasForeignKey(e => e.RcmCoordinatorId);
modelBuilder.Entity<Assignment>()
.HasOne(e => e.RcmMember)
.WithMany()
.HasForeignKey(e => e.RcmMemberId);
When I receive the Dto from the client, the RcmMemberId has a value for a valid User Id (the logged-in user would have selected a valid user created in the application from a dropdown list).
Upon running this line of code, I get an exception:
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_Assignments_AbpUsers_RcmMemberId". The conflict occurred in database "AppDb1", table "dbo.AbpUsers", column 'Id'.
The statement has been terminated.
The code that is causing the exception:
[UnitOfWork]
public async Task CreateAsync(UserIdentifier user, Assignment input)
{
// Assign an Rcm Coordinator
input.RcmCoordinatorId = user.UserId;
// Insert the record
await _repo.InsertAsync(input);
try
{
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{
var s = ex.ToString();
}
[UnitOfWork]
public async Task CreateAsync(UserIdentifier user, Assignment input)
{
// check if there is any collision
// TODO
//CheckCollision(input);
// Assign an Rcm Coordinator
input.RcmCoordinatorId = user.UserId;
// Insert the record
await _repo.InsertAsync(input);
try
{
await CurrentUnitOfWork.SaveChangesAsync();
}
catch (Exception ex)
{
var s = ex.ToString();
}
// Trigger the Workflow
await AssignToMember(input);
}
}
Hello, It is happening in the dev environment. For some reason, it stopped even creating the log file if I delete it.
Thanks Bilal
Hello,
For some reason, the application is not logging anything in the Log.txt file.
I even deleted the log file and then the application is not creating a new one.
Any hints to where I should be looking to help resolve this issue?
Thanks