Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "Leonardo.Willrich"

Hi,

I am trying to import records from a file and I do have separated files for each entity. So, first I want to insert all master records, and next insert all details record, however, when I try to read the master from the DB using EF, it is not working.

Basically, I would like it be working:

_typeRepository.Insert(new Type()
{
    Type = "test",
});

var typed = _typeRepository.GetAll().Where(a => a.Type == "test").FirstOrDefault();

In this example, typed is always null.

In the SQL Server Management Studio, If I create a transaction, insert a new record and perform a select, the record will be there.

How can I use the same transaction to performance the GetAll command?

Thanks in advance!

Hi,

I am using AspNetZero .Net Core JQuery framework and when I am publishing the Migrator project and running the Migrator.exe I am getting this exception below.

Does anyone an idea what is missing?

Thanks in advanced.

Exception:

2020-10-13 13:55:21 | Host database: Server=DbServer03; Database=iAPISDbProjectDBSERVER03; user id=iapis;password=T#FGEzZ8FSdv;
2020-10-13 13:55:21 | Continue to migration for this host database and all tenants..? (Y/N):
y
2020-10-13 13:55:22 | HOST database migration started...
2020-10-13 13:55:23 | An error occured during migration of host database:
2020-10-13 13:55:23 | Castle.MicroKernel.ComponentActivator.ComponentActivatorException: ComponentActivator: could not instantiate ASL.iAPIS.EntityFrameworkCore.iAPISDbContext
 ---> System.IO.FileNotFoundException: Could not load file or assembly 'System.Data.SqlClient, Version=4.6.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Data.SqlClient, Version=4.6.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimePropertyInfo.get_Signature()
   at System.Reflection.RuntimePropertyInfo.get_PropertyType()
   at System.Reflection.MemberInfoExtensions.GetMemberType(MemberInfo memberInfo)
   at Microsoft.EntityFrameworkCore.Metadata.Internal.MemberClassifier.FindCandidateNavigationPropertyType(MemberInfo memberInfo)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationshipDiscoveryConvention.GetNavigationCandidates(IConventionEntityType entityType)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationshipDiscoveryConvention.FindRelationshipCandidates(IConventionEntityTypeBuilder entityTypeBuilder)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationshipDiscoveryConvention.DiscoverRelationships(IConventionEntityTypeBuilder entityTypeBuilder, IConventionContext context)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.RelationshipDiscoveryConvention.ProcessEntityTypeAdded(IConventionEntityTypeBuilder entityTypeBuilder, IConventionContext`1 context)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnEntityTypeAdded(IConventionEntityTypeBuilder entityTypeBuilder)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.RunVisitor.VisitOnEntityTypeAdded(OnEntityTypeAddedNode node)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnEntityTypeAddedNode.Accept(ConventionVisitor visitor)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ConventionVisitor.Visit(ConventionNode node)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ConventionVisitor.VisitConventionScope(ConventionScope node)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ConventionBatch.Run()
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ConventionBatch.Dispose()
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.ImmediateConventionScope.OnModelInitialized(IConventionModelBuilder modelBuilder)
   at Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal.ConventionDispatcher.OnModelInitialized(IConventionModelBuilder modelBuilder)
   at Microsoft.EntityFrameworkCore.Metadata.Internal.Model..ctor(ConventionSet conventions)
   at Microsoft.EntityFrameworkCore.ModelBuilder..ctor(ConventionSet conventions)
   at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.CreateModel(DbContext context, IConventionSetBuilder conventionSetBuilder)
   at Microsoft.EntityFrameworkCore.Infrastructure.ModelSource.GetModel(DbContext context, IConventionSetBuilder conventionSetBuilder)
   at Microsoft.EntityFrameworkCore.Internal.DbContextServices.CreateModel()
   at Microsoft.EntityFrameworkCore.Internal.DbContextServices.get_Model()
   at Microsoft.EntityFrameworkCore.Infrastructure.EntityFrameworkServicesBuilder.<>c.<TryAddCoreServices>b__7_3(IServiceProvider p)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitFactory(FactoryCallSite factoryCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitConstructor(ConstructorCallSite constructorCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSiteMain(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitCache(ServiceCallSite callSite, RuntimeResolverContext context, ServiceProviderEngineScope serviceProviderEngine, RuntimeResolverLock lockType)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.VisitScopeCache(ServiceCallSite singletonCallSite, RuntimeResolverContext context)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteVisitor`2.VisitCallSite(ServiceCallSite callSite, TArgument argument)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.CallSiteRuntimeResolver.Resolve(ServiceCallSite callSite, ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.DynamicServiceProviderEngine.<>c__DisplayClass1_0.<RealizeService>b__0(ServiceProviderEngineScope scope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngine.GetService(Type serviceType, ServiceProviderEngineScope serviceProviderEngineScope)
   at Microsoft.Extensions.DependencyInjection.ServiceLookup.ServiceProviderEngineScope.GetService(Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService(IServiceProvider provider, Type serviceType)
   at Microsoft.Extensions.DependencyInjection.ServiceProviderServiceExtensions.GetRequiredService[T](IServiceProvider provider)
   at Microsoft.EntityFrameworkCore.DbContext.get_DbContextDependencies()
   at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
   at Microsoft.EntityFrameworkCore.DbContext.Microsoft.EntityFrameworkCore.Infrastructure.IInfrastructure<System.IServiceProvider>.get_Instance()
   at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService[TService](IInfrastructure`1 accessor)
   at Microsoft.EntityFrameworkCore.Infrastructure.AccessorExtensions.GetService[TService](IInfrastructure`1 accessor)
   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.get_Dependencies()
   at Microsoft.EntityFrameworkCore.Infrastructure.DatabaseFacade.Microsoft.EntityFrameworkCore.Internal.IDatabaseFacadeDependenciesAccessor.get_Dependencies()
   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetFacadeDependencies(DatabaseFacade databaseFacade)
   at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.SetCommandTimeout(DatabaseFacade databaseFacade, Nullable`1 timeout)
   at ASL.iAPIS.EntityFrameworkCore.iAPISDbContext..ctor(DbContextOptions`1 options) in D:\Source\iAPIS\Development\iAPIS_9.0.1\src\ASL.iAPIS.EntityFrameworkCore\EntityFrameworkCore\iAPISDbContext.cs:line 381
   at lambda_method(Closure , Object[] )
   at Castle.Core.Internal.ReflectionUtil.Instantiate(ConstructorInfo ctor, Object[] ctorArgs)
   at Castle.Core.Internal.ReflectionUtil.Instantiate[TBase](Type subtypeofTBase, Object[] ctorArgs)
   at Castle.Core.Internal.ReflectionUtil.CreateInstance[TBase](Type subtypeofTBase, Object[] ctorArgs)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType)


   --- End of inner exception stack trace ---
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstanceCore(ConstructorCandidate constructor, Object[] arguments, Type implType)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.CreateInstance(CreationContext context, ConstructorCandidate constructor, Object[] arguments)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.Instantiate(CreationContext context)
   at Castle.MicroKernel.ComponentActivator.DefaultComponentActivator.InternalCreate(CreationContext context)
   at Castle.MicroKernel.ComponentActivator.AbstractComponentActivator.Create(CreationContext context, Burden burden)
   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.CreateInstance(CreationContext context, Boolean trackedExternally)
   at Castle.MicroKernel.Lifestyle.AbstractLifestyleManager.Resolve(CreationContext context, IReleasePolicy releasePolicy)
   at Castle.MicroKernel.Handlers.DefaultHandler.ResolveCore(CreationContext context, Boolean requiresDecommission, Boolean instanceRequired, Burden& burden)
   at Castle.MicroKernel.Handlers.DefaultHandler.Resolve(CreationContext context, Boolean instanceRequired)
   at Castle.MicroKernel.Handlers.AbstractHandler.Resolve(CreationContext context)
   at Castle.MicroKernel.DefaultKernel.ResolveComponent(IHandler handler, Type service, Arguments additionalArguments, IReleasePolicy policy, Boolean ignoreParentContext)
   at Castle.MicroKernel.DefaultKernel.Castle.MicroKernel.IKernelInternal.Resolve(Type service, Arguments arguments, IReleasePolicy policy, Boolean ignoreParentContext)
   at Castle.MicroKernel.DefaultKernel.Resolve(Type service, Arguments arguments)
   at Castle.Windsor.WindsorContainer.Resolve[T](Arguments arguments)
   at Abp.Dependency.IocManager.Resolve[T](Object argumentsAsAnonymousType)
   at Abp.EntityFrameworkCore.DefaultDbContextResolver.Resolve[TDbContext](String connectionString, DbConnection existingConnection)
   at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator`1.CreateOrMigrate(AbpTenantBase tenant, Action`1 seedAction)
   at Abp.Zero.EntityFrameworkCore.AbpZeroDbMigrator`1.CreateOrMigrateForHost(Action`1 seedAction)
   at ASL.iAPIS.Migrator.MultiTenantMigrateExecuter.Run(Boolean skipConnVerification, Boolean isDockerEnabled) in D:\Source\iAPIS\Development\iAPIS_9.0.1\src\ASL.iAPIS.Migrator\MultiTenantMigrateExecuter.cs:line 64
2020-10-13 13:55:23 | Canceled migrations.
Press ENTER to exit...

I am using AspNetZero NET.Core JQuery version 9.0.1 and I have a website application in this solution.

I have created on the same solution an app for Droid and iOS using the projects already existing in the solution.

My question is if is it possible to create a new application for Droid using the same solution? Can I just duplicate the project .Droid creating a new folder, rename it, and then add it to the solution?

It will be a different application for different users. It will have a different layout, different context, different deploy/version. So, I don't think that using the same APK will be a good idea.

How can I do that?

Hi.

I am using ASP.NET CORE MVC & jQuery .NET Core 3.1 v9.0.1 and I got an issue with Localization.

I have the application hosted on AWS running under IIS version 8.5. This morning, for a while, all menus and labels were in brackets instead of showing the written name as per in the Localization file.

In the log I could only see that the localization was not found, for example:

WARN 2020-09-07 20:57:00,122 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'Materials' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,127 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'VisitObservationQuestionTemplates' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,132 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'TaskGroups' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,137 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'TaskTypes' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,142 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'VisitTemplates' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,147 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'VisitStatus' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,156 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'WorkerCrews' in localization source 'iAPIS'! WARN 2020-09-07 20:57:00,161 [52 ] naries.DictionaryBasedLocalizationSource - Can not find 'WorkerVehicles' in localization source 'iAPIS'!

It has affected all users and tenants.

And then, after 10 minutes, doing absolutely nothing, it has restored by itself.

Any idea about what happened?

I am converting an application AspNetZero MVC/JQuery .Core 3.1 from version 5.5 to version 9.0.1 and I am getting some issues with Background Worker routines.

In my background worker, I have some methods to check data and sent user notifications using INotificationPublisher. When there is some notification to be sent, it is raising an exception after the whole methods are done and the methods DoWork is completed successfully. Note, all notifications are persisted in the database correctly, but, there is no signalR to the browser to update the UI.

I have removed all background works and left on this one running in case of being a concurrency issue, but it didn't work, I am still getting this exception.

In version 5.5 all Background Workers are working well!

Here is the exception:

ERROR 2020-08-26 11:57:23,019 [65 ] ASL.iAPIS.Debugging.ExceptionHandlerEx - ExceptionHandlerEx Abp.BackgroundJobs.BackgroundJobException: A background job execution is failed. See inner exception for details. See BackgroundJob property to get information on the background job. ---> Abp.Domain.Uow.AbpDbConcurrencyException: Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. ---> Microsoft.EntityFrameworkCore.DbUpdateConcurrencyException: Database operation expected to affect 1 row(s) but actually affected 0 row(s). Data may have been modified or deleted since entities were loaded. See http://go.microsoft.com/fwlink/?LinkId=527962 for information on understanding and handling optimistic concurrency exceptions. at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ThrowAggregateUpdateConcurrencyException(Int32 commandIndex, Int32 expectedRowsAffected, Int32 rowsAffected) at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.ConsumeResultSetWithoutPropagation(Int32 commandIndex, RelationalDataReader reader) at Microsoft.EntityFrameworkCore.Update.AffectedCountModificationCommandBatch.Consume(RelationalDataReader reader) at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.Execute(IRelationalConnection connection) at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.Execute(IEnumerable1 commandBatches, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(IList1 entriesToSave) at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.SaveChanges(DbContext _, Boolean acceptAllChangesOnSuccess) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](TState state, Func3 operation, Func3 verifySucceeded) at Microsoft.EntityFrameworkCore.DbContext.SaveChanges(Boolean acceptAllChangesOnSuccess) at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges() --- End of inner exception stack trace --- at Abp.EntityFrameworkCore.AbpDbContext.SaveChanges() at Abp.Zero.EntityFrameworkCore.AbpZeroCommonDbContext3.SaveChanges() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChangesInDbContext(DbContext dbContext) at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.SaveChanges() at Abp.EntityFrameworkCore.Uow.EfCoreUnitOfWork.CompleteUow() at Abp.Domain.Uow.UnitOfWorkBase.Complete() at Abp.Domain.Uow.UnitOfWorkInterceptor.InterceptSynchronous(IInvocation invocation) at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.IRepository2Proxy_1.Delete(BackgroundJobInfo entity) at Abp.BackgroundJobs.BackgroundJobStore.Delete(BackgroundJobInfo jobInfo) at Castle.Proxies.BackgroundJobStoreProxy.Delete_callback(BackgroundJobInfo jobInfo) at Castle.Proxies.Invocations.IBackgroundJobStore_Delete.InvokeMethodOnTarget() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.DynamicProxy.AbstractInvocation.Proceed() at Castle.Proxies.BackgroundJobStoreProxy.Delete(BackgroundJobInfo jobInfo) at Abp.BackgroundJobs.BackgroundJobManager.TryProcessJob(BackgroundJobInfo jobInfo) --- End of inner exception stack trace ---

Here is the method to notify users about expired visits:

private void ProcessScheduledVisitExpired(DateTime startTime, int tenantId, List<LocalizableMessageNotificationData> emailBody)
        {

            Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - Start");

            var active = SettingManager.GetSettingValueForTenant<bool>(AppSettings.iApisNotificationRules.NotCompletedVisitExpiredActive, tenantId);
            if (!active)
            {
                Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - Aborted - Rule is not Actived");
                return;
            }

            var today = startTime.Date;
            var visitExpiredDays = SettingManager.GetSettingValueForTenant<int>(AppSettings.iApisNotificationRules.NotCompletedVisitExpiredDays, tenantId);
            var expiredDate = today.AddDays(-visitExpiredDays).Date;

            Logger.Debug("Notification Rules - ProcessScheduledVisitExpired- Scheduled Not Completed Visit Expired Days: " + visitExpiredDays.ToString());

            var expiredVisits = _visitReportRepository.GetAllIncluding(v => v.Apiary, v => v.Visit)
                .Where(v => v.IsComplete == false && v.Visit.ScheduledDate.HasValue == true && v.Visit.ScheduledDate.Value.Date <= expiredDate)
                .ToList();

            Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - expiredVisits lenght: " + expiredVisits.Count());

            foreach (var visit in expiredVisits)
            {
                Logger.Debug("Notification Rules - ProcessScheduledVisitExpired- processing visit: " + visit.VisitId);
                
                // Send the notification for users
                var notificationData = new LocalizableMessageNotificationData(
                new LocalizableString(
                    "ScheduledVisitExpired",
                    iAPISConsts.LocalizationSourceName
                    )
                );

                var days = visit.Visit.ScheduledDate.Value.Date.Subtract(today).Days + 1;
                notificationData["notificationType"] = "Visit Scheduled Expired";
                notificationData["visitId"] = visit.VisitId;
                notificationData["apiaryName"] = visit.Apiary.ApiaryName;
                notificationData["days"] = Math.Abs(days);

                Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - before Notification visit: " + visit.VisitId);

                emailBody.Add(notificationData);
                
                **// If this command is removed, the background Worker doesn't raise the exception.**
                _notificationPublisher.Publish(
                    AppNotificationNames.NotificationRules,
                    notificationData,
                    severity: NotificationSeverity.Info);

                Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - after Notification visit: " + visit.VisitId);
            }
            Logger.Debug("Notification Rules - ProcessScheduledVisitExpired - End");
        }

I am doing a migration from AspNetZero MVC/.Core JQuery version 5.5 to version 9.01 and I have found 3 issues that I cannot understand wy and in my point of view it is worst in the previous version. Can someone explain me why it has changed?

  1. Self-closing tags: Previous, I was able to user self-closing tags for TextArea ans Select.

Before: <select id="create-visit-crew" class="form-control w-100" />

Now: <select id="create-visit-crew" class="form-control w-100"> </select>

This element is used to create a kendo.ui.dropdown, so, I don't need add options on the cshtml file. Using version 9.0.1 if I don't add the close tag it don't close the tag, however, on version 5.5 there is no problem doing that.

  1. Object Mapper: Using version 5.5 some mappings there is no need to configure the map on CustomDtoMapper.cs file. But, on version 9.0.1, I had to configure all mappings objects (most of them are entity to dto). Is there some reason for that?

  2. LINQ queries are not working as before: Some queries simplely doesn't work on the same estruture and are raising an exception suggesting to rewrite the query.

For example, this query:

var visitMaterialsUsedRecords = _materialRepository.GetAll() .Where(m => visitDto.TaskIds.Contains(m.TaskId.Value)) .GroupBy(m => m.MaterialTemplateId.Value) .Select(m => new VisitMaterialsUsed() { VisitId = visitDto.Id.Value, VisitReportId = report.Id, MaterialTemplateId = m.First().MaterialTemplateId.Value, Quantity = m.Sum(mt => mt.Quantity), OriginallyScheduled = true, }).ToList();

It is raising this exeption:

The LINQ expression '(GroupByShaperExpression: KeySelector: (int)(m.MaterialTemplateId), ElementSelector:(EntityShaperExpression: EntityType: Material ValueBufferExpression: (ProjectionBindingExpression: EmptyProjectionMember) IsNullable: False ) ) .First()' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to either AsEnumerable(), AsAsyncEnumerable(), ToList(), or ToListAsync(). See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.

So, I had to rewrite to this:

``var visitMaterialsUsedRecords = _materialRepository.GetAll() .Where(m => visitDto.TaskIds.Contains(m.TaskId.Value)).AsEnumerable();

            var visitMaterialsUsed = visitMaterialsUsedRecords.GroupBy(m => m.MaterialTemplateId.Value)
                    .Select(m => new VisitMaterialsUsed()
                    {
                        VisitId = visitDto.Id.Value,
                        VisitReportId = report.Id,
                        MaterialTemplateId = m.First().MaterialTemplateId.Value,
                        Quantity = m.Sum(mt => mt.Quantity),
                        OriginallyScheduled = true,
                    }).ToList();``

Can some one explain why it has changed and what is wrong with the previous query?

Hi,

The Logger is not working in some situations. I wonder if someone else has the same problem and what I am missing to make it works.

Let me start explaining where I am using the Logger instance. I have a couple of classes that are instanced in the startup program and are used to read notifications from the database to update changes in my clients.

In these classes, I am creating a Logger instance to be able to catch exceptions and write down in the log file, as per the log4net.config configuration file. Those classes are located in the MVC project.

Basically, I have a local private property: private ILogger Logger { get; set; }

In the create method I assign this property like that: Logger = NullLogger.Instance;

and then writing the log like that: Logger.Error("Log Test ", ex);

My class is declared like that: public class AvaQueueHubService : ITransientDependency

And finally, creating an instance of my class in the Statup.cs, method Configure(), like that: _AvaQueueHubService = new AvaQueueHubService();

I tried to create the instance like that as well:

_CallLogHubService = serviceProvider.GetService<AvaQueueHubService>();

Does someone have any idea what I am missing?

Best regards!

Hi Guys,

I am getting a strange exception in the deployed release, in my development environment, it doesn't happen.

Does anyone have an idea what is wrong?

It is leaving my logs file full. However, seems that there is no interference in the application functionalities.

I tought maybe it would be some data in the database that was getting error. But even using exactly the same database from deployed version, it doesn't happen in development environment.

Exception: ERROR 2019-04-04 21:14:06,728 [35 ] Abp.Runtime.Caching.Redis.AbpRedisCache - Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: S. Path '', line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Abp.Runtime.Caching.Redis.DefaultRedisCacheSerializer.Deserialize(RedisValue objbyte) at Abp.Runtime.Caching.Redis.AbpRedisCache.Deserialize(RedisValue objbyte) at Abp.Runtime.Caching.Redis.AbpRedisCache.GetOrDefault(String key) at Abp.Runtime.Caching.CacheBase.GetOrDefaultAsync(String key) at Abp.Runtime.Caching.CacheBase.GetAsync(String key, Func2 factory) Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: S. Path '', line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue() at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter) at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent) at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType) at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings) at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings) at Abp.Runtime.Caching.Redis.DefaultRedisCacheSerializer.Deserialize(RedisValue objbyte) at Abp.Runtime.Caching.Redis.AbpRedisCache.Deserialize(RedisValue objbyte) at Abp.Runtime.Caching.Redis.AbpRedisCache.GetOrDefault(String key) at Abp.Runtime.Caching.CacheBase.GetOrDefaultAsync(String key) at Abp.Runtime.Caching.CacheBase.GetAsync(String key, Func2 factory)

Hi,

I am getting a Warn in my log files in the server:

naries.DictionaryBasedLocalizationSource - Can not find 'MainMenu' in localization source 'Abp'!

It only happens when my application is published and running in IIS server. In my local develop machine it doesn't happen.

Futhermore, in my .xml file I have it specified: <text name="MainMenu">Main menu</text>

Some idea what is going on?

Cheers.

Hi,

When I am deploing my application I am getting this error: StackExchange.Redis.RedisTimeoutException: Timeout. In my development environment it doesn't happen.

It only happens for Caches used by AbpZero framework (i.e. AbpZeroTenantCache, AbpTenantSettingsCache). Using caches created by my routines I am not getting any issue.

I have already read the article http://stackexchange.github.io/StackExchange.Redis/Timeouts, but so far I have any idea how to fix it.

Any idea how to fix those exceptions? My log files is getting full.

Best regards!

Full exception:

2019-02-28 01:30:53,937 [37 ] Abp.Runtime.Caching.Redis.AbpRedisCache - StackExchange.Redis.RedisTimeoutException: Timeout performing GET n:AbpZeroTenantCache,c:2, inst: 3, queue: 12, qu: 0, qs: 12, qc: 0, wr: 0, wq: 0, in: 4257, ar: 0, clientName: FRESHRF, serverEndpoint: Unspecified/localhost:6379, keyHashSlot: 10529 (Please take a look at this article for some common client-side issues that can cause timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts)
at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 2120
at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\RedisBase.cs:line 81
at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs:line 1647
at Abp.Runtime.Caching.Redis.AbpRedisCache.GetOrDefault(String key)
at Abp.Runtime.Caching.CacheBase.Get(String key, Func`2 factory)
StackExchange.Redis.RedisTimeoutException: Timeout performing GET n:AbpZeroTenantCache,c:2, inst: 3, queue: 12, qu: 0, qs: 12, qc: 0, wr: 0, wq: 0, in: 4257, ar: 0, clientName: FRESHRF, serverEndpoint: Unspecified/localhost:6379, keyHashSlot: 10529 (Please take a look at this article for some common client-side issues that can cause timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts)
at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 2120
at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\RedisBase.cs:line 81
at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags) in c:\code\StackExchange.Redis\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs:line 1647
at Abp.Runtime.Caching.Redis.AbpRedisCache.GetOrDefault(String key)
at Abp.Runtime.Caching.CacheBase.Get(String key, Func`2 factory)
Showing 11 to 20 of 20 entries