Activities of "Sturla"

And one more thing... can you please not remove the comments I put on my properties? That would be awesome ;-)

can you give details and concrete examples about your solution

My services/controllers have more functions than just related to talking to the database so I have stuff like

public interface ICarsAppService : IApplicationService
{
    Task<CarsDto> GetAsync(Guid id);
    // ...etc. CRUD stuff from Suite
    
    //And then I have custom stuff like this that is not db/crud related
    Task UploadCarImageBlobAsync(string blobName);
    // ...etc
    // all of this gets removed and I need to add it again...
}

But then I also have changes in the CRUD methods e.g. swapping out their content and calling a Manager.

And then Suite also removes all the extra private readonly members (and from the constructors) so I need to add it all back in.

Now I try to add all my changes to code at the bottom so its easier to update with suite. I just copy/paste the removed code back in!

Why not just keep what is not ABP Crud? Why delete it all?

And since we are at it... can we have Suite also have the possibility to have a this. option instead of having all members starting with _ ?

I would go further and do it with services and controllers also!

I´m always adding something custom and its a pain to update. Nb. I´m not still gone live so I can iterate fast but would love to do it even faster!

Answer

For some reason all my EF Core repository tests are failing (like https://github.com/abpframework/abp/issues/10822) with the following exception

Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module Beinni.BeinniTestBaseModule, Beinni.TestBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: String reference not set to an instance of a String. (Parameter 's'). See the inner exception for details.
---- System.ArgumentNullException : String reference not set to an instance of a String. (Parameter 's')

And that is after I had to add the following code in TestBaseModule as recommended after I started getting SqliteConnection does not support nested transactions..

Configure<AbpUnitOfWorkDefaultOptions>(options =>
{
    options.TransactionBehavior = UnitOfWorkTransactionBehavior.Disabled;
});`

I also tried this this approach but still this ""String reference.. " error.

And its not this either.

I have re-compared everything and there aren´t any changes in the test projects that I'm missing.

Any ideas?

The full stack trace is this

Stack Trace:  ModuleManager.InitializeModules(ApplicationInitializationContext context) AbpApplicationBase.InitializeModules() AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) AbpIntegratedTest1.ctor() BeinniTestBase1.ctor() BeinniEntityFrameworkCoreTestBase.ctor() BankInformationRepositoryTests.ctor() line 15 RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) ----- Inner Stack Trace ----- Encoding.GetBytes(String s) UserCustomerSyncronizer.Sign(String method, String urlPath, String salt, Int64 timestamp, String body) line 111 UserCustomerSyncronizer.MakeRequestAsync(Method method, String urlPath, String body) line 80 UserCustomerSyncronizer.HandleEventAsync(EntityCreatedEto1 eventData) line 42 EventBusBase.TriggerHandlerAsync(IEventHandlerFactory asyncHandlerFactory, Type eventType, Object eventData, List1 exceptions, InboxConfig inboxConfig) AbpExceptionExtensions.ReThrow(Exception exception) EventBusBase.ThrowOriginalExceptions(Type eventType, List1 exceptions) EventBusBase.TriggerHandlersAsync(Type eventType, Object eventData) LocalEventBus.PublishAsync(LocalEventMessage localEventMessage) LocalEventBus.PublishToEventBusAsync(Type eventType, Object eventData) EventBusBase.PublishAsync(Type eventType, Object eventData, Boolean onUnitOfWorkComplete) UnitOfWorkEventPublisher.PublishDistributedEventsAsync(IEnumerable1 distributedEvents) UnitOfWork.CompleteAsync(CancellationToken cancellationToken) UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) &lt;&lt;SeedTestData&gt;b__0>d.MoveNext() line 62 --- End of stack trace from previous location --- TaskExtensions.WaitAndUnwrapException(Task task) &lt;&gt;c__DisplayClass15_0.&lt;Run&gt;b__0(Task t) ContinuationTaskFromTask.InnerInvoke() &lt;.cctor&gt;b__272_0(Object obj) ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- TaskExtensions.WaitAndUnwrapException(Task task) AsyncContext.Run(Func1 action) AsyncHelper.RunSync(Func1 action) BeinniTestBaseModule.SeedTestData(ApplicationInitializationContext context) line 58 BeinniTestBaseModule.OnApplicationInitialization(ApplicationInitializationContext context) line 53 OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) ModuleManager.InitializeModules(ApplicationInitializationContext context)

Answer

Suite is now forcing me to remove TenantId column in a none multitenant table (doesn´t inherit from IMultiTenant)!

Invalid property names! You need to remove the following properties which are reserved properties and come with ABP base classes: TenantId

The thing is I need that column (I'm currently using it) to know what tenant created the record in that table.

The content is available for every other tenant on a central index page (showing stuff from all tenants) and then also used to display just what the individual tenant created on their subdomain page.

Why do you need to restrict this?

And what do you recommend here?

  1. Make all the entities IMulitTenant and disable the MulitTenant part where needed?
    1. If I do this and update all my repository method get tenantId removed from them so I can´t filter after tenantId...
  2. Change the column to TenantCreatorId (CreatedByTenantId) ?

Finally found this out... you need to add WithExposedHeaders("customheader")for all the headers you want to include. Now this is being returned!

Closing this

OK I found out what is stripping the headers away

WithAbpExposedHeaders()

if I swap that out with

WithExposedHeaders("*")

I get all the headers.

But what does that mean and is that a viable sultion?

Ok I found an issue talking about this here

.. in the Blazor WASM application, there is no need to use cookies for authentication. So browser cross origins, headers are removed, and the response headers are not returned in the success event.

and then says

As a result, we recommend calling the AllowCredentials() method, as shown in the code snippet below, to allow header configuration in the startup page.

But my ConfigureCors() is just the same (similar)

But something must be stripping out the headers so any idea?

Yes I can't see that its returned in their SuccessEventArgs. Any idea?

Ok didn’t see it because I was just looking at the response in code. Then the method Im using there to get the headers is not a good one (just using Syncfusion code example)

Showing 151 to 160 of 210 entries
Made with ❤️ on ABP v9.0.0-preview Updated on September 19, 2024, 10:13