Starts in:
1 DAY
0 HR
45 MIN
0 SEC
Starts in:
1 D
0 H
45 M
0 S

Activities of "sunivycsm"

Hi, I've tried but still get error. In my azure ad, i setup to localhost:

But after call to microsft account successfull, it still gets the error:

My config in module is:

Plz help me.

Question

  • ABP Framework version: vX.X.X
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • **Tiered (for MVC): no
  • Exception message and full stack trace: An unhandled exception occurred while processing the request. JsonReaderException: The input does not contain any JSON tokens. Expected the input to start with a valid JSON token, when isFinalBlock is true. LineNumber: 0 | BytePositionInLine: 0. System.Text.Json.ThrowHelper.ThrowJsonReaderException(ref Utf8JsonReader json, ExceptionResource resource, byte nextByte, ReadOnlySpan<byte> bytes)

AuthenticationFailureException: An error was encountered while handling the remote login. Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<TOptions>.HandleRequestAsync()

  • Steps to reproduce the issue:
  • I login completed into Azure AD, filled the ClientID and Client Key

My app has been in development for a while and is not a new creation. If it was a new creation, the conversion would be simple.

I have built an MVC application and am using the Lepton theme. Now I want to use the LeptonX theme. How should I modify my project, and where should I make these changes?

  • ABP Framework version: vX.X.X
  • UI Type: MVC
  • Database System: SQL Server

@liangshiwei Here is my source code. When I add AsNoTracking I get the following error: Should I add any additional libraries?

using CMCUNI_THUCTAP.NganhHocs; using Volo.Abp.Identity; using CMCUNI_THUCTAP.TrinhDos; using CMCUNI_THUCTAP.Khoas; using System; using System.IO; using System.Linq; using System.Collections.Generic; using System.Threading.Tasks; using System.Linq.Dynamic.Core; using Microsoft.AspNetCore.Authorization; using Volo.Abp; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; using CMCUNI_THUCTAP.Permissions; using CMCUNI_THUCTAP.GiangViens; using MiniExcelLibs; using Volo.Abp.Content; using Volo.Abp.Authorization; using Volo.Abp.Caching; using Microsoft.Extensions.Caching.Distributed; using CMCUNI_THUCTAP.Shared;

namespace CMCUNI_THUCTAP.GiangViens {

[Authorize(CMCUNI_THUCTAPPermissions.GiangViens.Default)]
public abstract class GiangViensAppServiceBase : CMCUNI_THUCTAPAppService
{
    protected IDistributedCache&lt;GiangVienExcelDownloadTokenCacheItem, string&gt; _excelDownloadTokenCache;
    protected IGiangVienRepository _giangVienRepository;
    protected GiangVienManager _giangVienManager;
    protected IRepository&lt;Khoa, Guid&gt; _khoaRepository;
    protected IRepository&lt;TrinhDo, Guid&gt; _trinhDoRepository;
    protected IRepository&lt;IdentityUser, Guid&gt; _identityUserRepository;
    protected IRepository&lt;NganhHoc, Guid&gt; _nganhHocRepository;

    public GiangViensAppServiceBase(IGiangVienRepository giangVienRepository, GiangVienManager giangVienManager, IDistributedCache&lt;GiangVienExcelDownloadTokenCacheItem, string&gt; excelDownloadTokenCache, IRepository&lt;Khoa, Guid&gt; khoaRepository, IRepository&lt;TrinhDo, Guid&gt; trinhDoRepository, IRepository&lt;IdentityUser, Guid&gt; identityUserRepository, IRepository&lt;NganhHoc, Guid&gt; nganhHocRepository)
    {
        _excelDownloadTokenCache = excelDownloadTokenCache;
        _giangVienRepository = giangVienRepository;
        _giangVienManager = giangVienManager; _khoaRepository = khoaRepository;
        _trinhDoRepository = trinhDoRepository;
        _identityUserRepository = identityUserRepository;
        _nganhHocRepository = nganhHocRepository;
    }

    public virtual async Task&lt;PagedResultDto&lt;GiangVienWithNavigationPropertiesDto&gt;> GetListAsync(GetGiangViensInput input)
    {
        var totalCount = await _giangVienRepository.GetCountAsync(input.FilterText, input.MaGiangVien, input.TenGiangVien, input.KhoaId, input.TrinhDoId, input.IdentityUserId, input.NganhHocId);
        var items = await _giangVienRepository.GetListWithNavigationPropertiesAsync(input.FilterText, input.MaGiangVien, input.TenGiangVien, input.KhoaId, input.TrinhDoId, input.IdentityUserId, input.NganhHocId, input.Sorting, input.MaxResultCount, input.SkipCount);

        return new PagedResultDto&lt;GiangVienWithNavigationPropertiesDto&gt;
        {
            TotalCount = totalCount,
            Items = ObjectMapper.Map&lt;List&lt;GiangVienWithNavigationProperties&gt;, List&lt;GiangVienWithNavigationPropertiesDto&gt;>(items)
        };
    }

    public virtual async Task&lt;GiangVienWithNavigationPropertiesDto&gt; GetWithNavigationPropertiesAsync(Guid id)
    {
        return ObjectMapper.Map&lt;GiangVienWithNavigationProperties, GiangVienWithNavigationPropertiesDto&gt;
            (await _giangVienRepository.GetWithNavigationPropertiesAsync(id));
    }

    public virtual async Task&lt;GiangVienDto&gt; GetAsync(Guid id)
    {
        return ObjectMapper.Map&lt;GiangVien, GiangVienDto&gt;(await _giangVienRepository.GetAsync(id));
    }

    public virtual async Task&lt;PagedResultDto&lt;LookupDto&lt;Guid&gt;>> GetKhoaLookupAsync(LookupRequestDto input)
    {
        var query = (await _khoaRepository.GetQueryableAsync())
            .WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
                x => x.TenKhoa != null &&
                     x.TenKhoa.Contains(input.Filter));

        var lookupData = await query.PageBy(input.SkipCount, input.MaxResultCount).ToDynamicListAsync&lt;Khoa&gt;();
        var totalCount = query.Count();
        return new PagedResultDto&lt;LookupDto&lt;Guid&gt;>
        {
            TotalCount = totalCount,
            Items = ObjectMapper.Map&lt;List&lt;Khoa&gt;, List&lt;LookupDto&lt;Guid&gt;>>(lookupData)
        };
    }

    public virtual async Task&lt;PagedResultDto&lt;LookupDto&lt;Guid&gt;>> GetTrinhDoLookupAsync(LookupRequestDto input)
    {
        var query = (await _trinhDoRepository.GetQueryableAsync())
            .WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
                x => x.TenTrinhDo != null &&
                     x.TenTrinhDo.Contains(input.Filter));

        var lookupData = await query.PageBy(input.SkipCount, input.MaxResultCount).ToDynamicListAsync&lt;TrinhDo&gt;();
        var totalCount = query.Count();
        return new PagedResultDto&lt;LookupDto&lt;Guid&gt;>
        {
            TotalCount = totalCount,
            Items = ObjectMapper.Map&lt;List&lt;TrinhDo&gt;, List&lt;LookupDto&lt;Guid&gt;>>(lookupData)
        };
    }

    public virtual async Task&lt;PagedResultDto&lt;LookupDto&lt;Guid&gt;>> GetIdentityUserLookupAsync(LookupRequestDto input)
    {
        var query = (await _identityUserRepository.GetQueryableAsync())
            .WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
                x => x.Name != null &&
                     x.Name.Contains(input.Filter));

        var lookupData = await query.PageBy(input.SkipCount, input.MaxResultCount).ToDynamicListAsync&lt;IdentityUser&gt;();
        var totalCount = query.Count();
        return new PagedResultDto&lt;LookupDto&lt;Guid&gt;>
        {
            TotalCount = totalCount,
            Items = ObjectMapper.Map&lt;List&lt;IdentityUser&gt;, List&lt;LookupDto&lt;Guid&gt;>>(lookupData)
        };
    }

    public virtual async Task&lt;PagedResultDto&lt;LookupDto&lt;Guid&gt;>> GetNganhHocLookupAsync(LookupRequestDto input)
    {
        var query = (await _nganhHocRepository.GetQueryableAsync())
            .WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
                x => x.TenNganh != null &&
                     x.TenNganh.Contains(input.Filter));

        var lookupData = await query.PageBy(input.SkipCount, input.MaxResultCount).ToDynamicListAsync&lt;NganhHoc&gt;();
        var totalCount = query.Count();
        return new PagedResultDto&lt;LookupDto&lt;Guid&gt;>
        {
            TotalCount = totalCount,
            Items = ObjectMapper.Map&lt;List&lt;NganhHoc&gt;, List&lt;LookupDto&lt;Guid&gt;>>(lookupData)
        };
    }

    [Authorize(CMCUNI_THUCTAPPermissions.GiangViens.Delete)]
    public virtual async Task DeleteAsync(Guid id)
    {
        await _giangVienRepository.DeleteAsync(id);
    }

    [Authorize(CMCUNI_THUCTAPPermissions.GiangViens.Create)]
    public virtual async Task&lt;GiangVienDto&gt; CreateAsync(GiangVienCreateDto input)
    {
        if (input.KhoaId == default)
        {
            throw new UserFriendlyException(L["The {0} field is required.", L["Khoa"]]);
        }
        if (input.TrinhDoId == default)
        {
            throw new UserFriendlyException(L["The {0} field is required.", L["TrinhDo"]]);
        }

        var giangVien = await _giangVienManager.CreateAsync(
        input.NganhHocIds, input.KhoaId, input.TrinhDoId, input.IdentityUserId, input.MaGiangVien, input.TenGiangVien
        );

        return ObjectMapper.Map&lt;GiangVien, GiangVienDto&gt;(giangVien);
    }

    [Authorize(CMCUNI_THUCTAPPermissions.GiangViens.Edit)]
    public virtual async Task&lt;GiangVienDto&gt; UpdateAsync(Guid id, GiangVienUpdateDto input)
    {
        if (input.KhoaId == default)
        {
            throw new UserFriendlyException(L["The {0} field is required.", L["Khoa"]]);
        }
        if (input.TrinhDoId == default)
        {
            throw new UserFriendlyException(L["The {0} field is required.", L["TrinhDo"]]);
        }

        var giangVien = await _giangVienManager.UpdateAsync(
        id,
        input.NganhHocIds, input.KhoaId, input.TrinhDoId, input.IdentityUserId, input.MaGiangVien, input.TenGiangVien, input.ConcurrencyStamp
        );

        return ObjectMapper.Map&lt;GiangVien, GiangVienDto&gt;(giangVien);
    }

    [AllowAnonymous]
    public virtual async Task&lt;IRemoteStreamContent&gt; GetListAsExcelFileAsync(GiangVienExcelDownloadDto input)
    {
        var downloadToken = await _excelDownloadTokenCache.GetAsync(input.DownloadToken);
        if (downloadToken == null || input.DownloadToken != downloadToken.Token)
        {
            throw new AbpAuthorizationException("Invalid download token: " + input.DownloadToken);
        }

        var giangViens = await _giangVienRepository.GetListWithNavigationPropertiesAsync(input.FilterText, input.MaGiangVien, input.TenGiangVien, input.KhoaId, input.TrinhDoId, input.IdentityUserId, input.NganhHocId);
        var items = giangViens.Select(item => new
        {
            MaGiangVien = item.GiangVien.MaGiangVien,
            TenGiangVien = item.GiangVien.TenGiangVien,

            Khoa = item.Khoa?.TenKhoa,
            TrinhDo = item.TrinhDo?.TenTrinhDo,
            IdentityUser = item.IdentityUser?.Name,

        });

        var memoryStream = new MemoryStream();
        await memoryStream.SaveAsAsync(items);
        memoryStream.Seek(0, SeekOrigin.Begin);

        return new RemoteStreamContent(memoryStream, "GiangViens.xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
    }

    public virtual async Task&lt;CMCUNI_THUCTAP.Shared.DownloadTokenResultDto&gt; GetDownloadTokenAsync()
    {
        var token = Guid.NewGuid().ToString("N");

        await _excelDownloadTokenCache.SetAsync(
            token,
            new GiangVienExcelDownloadTokenCacheItem { Token = token },
            new DistributedCacheEntryOptions
            {
                AbsoluteExpirationRelativeToNow = TimeSpan.FromSeconds(30)
            });

        return new CMCUNI_THUCTAP.Shared.DownloadTokenResultDto
        {
            Token = token
        };
    }
}

}

Sorry, this code doesn't work.

Question

I am selecting user _identityUserRepository.

  var query = (await _identityUserRepository.GetQueryableAsync())
      .WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
          x => x.Name != null &&
               x.Name.Contains(input.Filter));

But when I use the following code, it is automatically saved in the datatable.
foreach (var item in query)
{
     item.Name = item.Surname + item.Name;
}

Is there a way I can edit the data without automatically updating it to the database? Here is all my source information:

public virtual async Task<PagedResultDto<LookupDto<Guid>>> GetIdentityUserLookupAsync(LookupRequestDto input)
{
    var query = (await _identityUserRepository.GetQueryableAsync())
        .WhereIf(!string.IsNullOrWhiteSpace(input.Filter),
            x => x.Name != null &&
                 x.Name.Contains(input.Filter));

    foreach (var item in query)
    {
        item.Name = item.Surname + item.Name
    }

    var lookupData = await query.PageBy(input.SkipCount, input.MaxResultCount).ToDynamicListAsync<IdentityUser>();
    var totalCount = query.Count();
    return new PagedResultDto<LookupDto<Guid>>
    {
        TotalCount = totalCount,
        Items = ObjectMapper.Map<List<IdentityUser>, List<LookupDto<Guid>>>(lookupData)
    };
}
  • ABP Framework version: v7.4.1
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes/no
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

Hi, Thank you. I will give it a try.

Hello, What should I do next?

Showing 1 to 10 of 56 entries
Made with ❤️ on ABP v9.1.0-preview. Updated on November 20, 2024, 13:06