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

Activities of "andmattia"

Angular + .NET Core + Zero (7.2 abp 4.8.1)

We want to autenticate user from external app without passing user & password but a token.

In first option we use and encripetd token with user data and login this user, after login complete we use impersonate to move to real user. It works but we have an open issue. If user click on impersonate back it return to user used to login.

Is it possibile impersonate user directly without a password?

I fonud a typing error we use IDbSet in place off DbSet.

I fix and it works.

Abp 4.8.1 / EF Core 2.2

We are moving from .Net to .Net Core so now we need to convert a part where we need to call a remote MySql Server. In the past version we add a same issue and we solve it via Database.SetInitializer(null); but in EF Core this strategy cann't be applied.

Releted to our old thred Multi Db Context MySQL / MSSQL

Anyone has found a way to do that?

Hi

the error message is NotSupportedException because the Linq interpreter not call the SQL Json Function but call static class

  • 4.8.1
  • Angular
  • .net core 2.2 / .net 4.6.1

Hi

we have an issue on abp and LINQ to SQL. We have create a JSON_VALUE function and it works fine until we try to call it from IQuerable static extension. Our project is very complex but I have create a empty project and add 2 DLL to reproduce the error. The step are:

  1. create 1 DLL (abp module or not is the same)

  2. create and abstract class to extend a AppService

  3. cerate a IQuerable extension to add a where with JSON_VALUE dbFunction

  4. if I call in base abstract class where I call ToList / ToArray I catch a NotImplemented Exception

  5. if I add the where directly on AppService and call ToList/ToArray the SQL will be translatend in correct way

            var query = from auditLog in _repository.GetAll()
                join user in _repositoryUser.GetAll() on auditLog.EditionId equals user.Id into userJoin
                from joinedUser in userJoin.DefaultIfEmpty()
                //where DemoEfCoreSqlJsonExtension.JsonValue(auditLog.TenancyName,"$") != null
                select new FullTenant { TenancyName = auditLog.TenancyName, Tenant = auditLog, Edition = joinedUser };
                
                var hjkh =  query.ToList();
                
                
                public static class DemoEfCoreSqlJsonExtension
    {
        [DbFunction("JSON_VALUE", "")]
        public static string JsonValue(string column, [NotParameterized] string path)
        {
            throw new NotSupportedException();
        }

        [DbFunction("JSON_QUERY", "")]
        public static string JsonQuery(string column, [NotParameterized] string path)
        {
            throw new NotSupportedException();
        }
    }
    
    public static class DemoQueryableExtensions
    {
        public static IQueryable<TGetAllListResult> DemoApplyExtraFieldFilter<TGetAllListResult>(
            this IQueryable<TGetAllListResult> query)
            where TGetAllListResult : class, IDynamicTelerikExtraFields
        {
            return Queryable.Where(query, x => DemoEfCoreSqlJsonExtension.JsonValue(x.TenancyName, "$") != null && Convert.ToDecimal(DemoEfCoreSqlJsonExtension.JsonValue(x.TenancyName, "$")) == 7);
        }
    }
    
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            modelBuilder.HasDbFunction(() => DemoEfCoreSqlJsonExtension.JsonValue(default(string), default(string)));
            modelBuilder.HasDbFunction(() => DemoEfCoreSqlJsonExtension.JsonQuery(default(string), default(string)));

It wokrs only on AppService or Core Module but not from static Extension

I try to test the new version (lastest) and the test UI not work.

I try to update karma but the result is the same

Prerequisites

  • 7.1.0

  • Angular

  • .NetCore 2.2

  • all theme

I try to execute test via ng test or yarn test or yarn e2e but no one works I get this error on chrome

and on VSCode

How can I check what is wrong?

Regards

Hi after a lot of rework I found a partial solution to our context

public override void PreInitialize()
        {
            //....
             RegisterFakeService<firstDbContext>();
            RegisterFakeService<secondDbContext>();
            //....
            }

RegisterIdentity(iocManager);

            var builder = new DbContextOptionsBuilder<firstDbContext>();
            var builder2 = new DbContextOptionsBuilder<secondDbContext>();

            var sqlite1 = new SqliteConnection("Data Source=firstDbContext.db");
            var sqlite2 = new SqliteConnection("Data Source=secondDbContext.db");
            
            builder.UseSqlite(sqlite1);
            builder2.UseSqlite(sqlite2);
            
            iocManager.IocContainer.Register(
                Component
                    .For<DbContextOptions<firstDbContext>>()
                    .Instance(builder.Options)
                    .LifestyleSingleton()
            );

            iocManager.IocContainer.Register(
                Component
                    .For<DbContextOptions<secondDbContext>>()
                    .Instance(builder2.Options)
                    .LifestyleSingleton()
            );

            sqlite1.Open();
            sqlite2.Open();

            new firstDbContext(builder.Options).Database.EnsureCreated();
            new secondDbContext(builder2.Options).Database.EnsureCreated();

So now I have a problem related to sqlLite that I not allow multiple connection. So I need to check if I can redo Seed or other strategy

I think this issue is related to our arch beacuse we have 2 DbContext in 2 separate EFCore project. So when application run normally 2 dbcontext are resolved normally but during the test I see that test base project use a "fake" dbcontext (based on sqlLite).

I look into the demo app with 2 dbcontext but is not our case (because we use 2 different project).

Any Idea how can I start my Test with 2 dbContext?

Showing 41 to 50 of 200 entries