Hi,
I tried both:
var Object = await _objectRepository.GetAsync(input.Id);
await _objectRepository.DeleteAsync(Object);
and: await _objectRepository.DeleteAsync(input.Id);
but I have the Validation Error.
Thank you
Hi, I already overrided the SaveChanges() Method, there is nothing useful there.
May entities are the following:
[Table("MyObjects")] public class MyObject : FullAuditedEntity, IMustHaveTenant { [Required] public virtual string Name { get; set; }
[Required] //->with this I am not able to soft-delete
public virtual MyObjectType Type { get; set; }
public virtual MyObject Parent { get; set; }
}
[Table("MyObjectTypes")] public class MyObjectType : FullAuditedEntity, IMustHaveTenant { [Required] public virtual string Description { get; set; }
public virtual bool AllowChildNodes { get; set; }
public virtual bool IsDefault { get; set; }
}
I am only able to soft-delete the entries of MyObject when the property Type (MyObjectType ) is not required. Why is this happening?
Nope, there is nothing useful in the Logs.txt, only:
Handling.AbpApiExceptionFilterAttribute - Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. at System.Data.Entity.Internal.InternalContext.SaveChangesAsync(CancellationToken cancellationToken) at System.Data.Entity.Internal.LazyInternalContext.SaveChangesAsync(CancellationToken cancellationToken) at Abp.EntityFramework.AbpDbContext.<SaveChangesAsync>d__38.MoveNext() in D:\Halil\GitHub\aspnetboilerplate\src\Abp.EntityFramework\EntityFramework\AbpDbContext.cs:line 208 --- End of stack trace from previous location where exception was thrown ---
Hi,
I would like to know how can I decode the famous exception: System.Data.Entity.Validation.DbEntityValidationException: Validation failed for one or more entities. See 'EntityValidationErrors' property for more details.
with no details about what it is wrong with a simple soft-delete of an weak Entity with a relation to another Entity. What can go wrong in this case? I already try to override the SaveChanges() and use a try/catch to look at the details in the DbContext but with no luck.
Thanks DP