"mmaldonado@emscltd.com" की गतिविधियाँ

उत्तर

Let me know when you fix this problem please to delete my own implementation

सवाल
  • ABP Framework version: 6.0.0.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Steps to reproduce the issue:

Error on generating GUID, portion of code from repository to set Id

Class EfCoreRepository

`protected virtual void CheckAndSetId(TEntity entity) { if (entity is IEntity

protected virtual void TrySetGuidId(IEntity<Guid> entity)
{
    if (entity.Id != default)
    {
        return;
    }

    EntityHelper.TrySetId(
        entity,
        () => GuidGenerator.Create(),
        true
    );
}`

the guid generated does not match the pattern for GUIDs [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12} based on https://datatracker.ietf.org/doc/html/rfc4122

Partial solution

public class GuidValueGenerator : ValueGenerator<Guid> { private readonly IGuidGenerator _guidGenerator; private readonly string pattern = @"^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$";

public override bool GeneratesTemporaryValues => false;

public GuidValueGenerator()
{
    var options = Options.Create(new AbpSequentialGuidGeneratorOptions());
    options.Value.DefaultSequentialGuidType = SequentialGuidType.SequentialAtEnd;

    _guidGenerator = new SequentialGuidGenerator(options);
}


public override Guid Next(EntityEntry entry)
{
    var result = GenerateNextValue();

    string json = JsonConvert.SerializeObject(entry.Entity);

    WriteOnText(result.ToString());
    WriteOnText(json);

    return result;
}

public Guid GenerateNextValue()
{
    var result = _guidGenerator.Create();

    if (!Regex.IsMatch(result.ToString(), pattern))
    {
        return GenerateNextValue();
    }

    return result;
}

public void WriteOnText(string newGuid)
{
    string filePath = @"D:\guid-lines.txt"; // Replace with your file path

    // Open the file for writing
    using (StreamWriter writer = new StreamWriter(filePath, true))
    {
        writer.WriteLine(newGuid);
    }
}

}

Solved

Check list about errors

  • Change the dynamic proxy to static
    • Not sure why it does not work with dynamic but after fix all errors it did not work with dynamic
    • I have an integration with IdentityService, and my gateway expose 7 different services, not sure if it is related
  • Fix the app service name to use AppService post fix
    • It was one service that was not resolved so is better to follow name conventions
  • The generations of the client has to be on the owner of the implementation
    • I was creating a client of MicroService B inside MicroService A
    • Also the reference of projects was not correct

Thanks so much for your help

Hi,

Open the ServiceBHttpClientModule class and change AddHttpClientProxies to AddStaticHttpClientProxies

You can search for AddHttpClientProxies globally and replace it with AddStaticHttpClientProxies in the MicroserviceB solution.

Hi,

I am still facing a problem, is it possible to set a meeting to show you so you could help me find the error?

Hi,

It looks like you are using the Dynamic proxy.

The Dynamic proxy system needs to get the API defines from the gateway.

You can consider using the Static proxy.

  • Run the abp generate-proxy -t csharp -m TheModuleNameOfServiceB -u TheURLOfServiceB on the ServiceB.HttpApi.Client project directory
  • Open the ServiceBHttpClientModule class and change AddHttpClientProxies to AddStaticHttpClientProxies

Now it should be working.

If you don't know the TheModuleNameOfServiceB, you can access the TheURLOfServiceB:/api/abp/api-definition endpoint to check it.

Hi,

It still load with dynamic proxy

  • ABP Framework version: 6.0.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes

I am facing problems to connect between micro services - sync. I know the problem is under my environment due to I tried to replicate on a empty solution from the beginning and it worked correctly.

So I would like to know if you could help me to find the error on my environment, and which information could be useful to share with you.

As initial thought I would like to share with you the error that I am facing is fired by ApiDescriptionFinder.FindActionAsync

throw new AbpException($"Could not found remote action for method: {method} on the URL: {baseUrl}");

after the call to the function throw the interface.

As second thought I already have an integration to identity service from the same microservice, so I do not know why I am facing this error

उत्तर

you should modify the function

mapEnumToOptions(CustomDataType);

on microservices to get the localization of service

उत्तर

It did not work, since i am on microservice template I have to use the prefix of the owner

const label: string = this.localizationService.instant('MyService::Enum:' + enumTypeName + '.' + element.key);

सवाल
  • ABP Framework version: 5.3.4
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Template: microservices

I would like some help to display labels on Dropdowns using Enums

public enum ContactType
    {
        NotSelected = 0, // Label: "Not Selected"

        /// <remarks/>
        [System.Xml.Serialization.XmlEnum("1")]
        Administrative_Assistant = 1, // Label: "Administrative Assistant (101) "

        /// <remarks/>
        [System.Xml.Serialization.XmlEnum("2")]
        Medical_Director = 2, // Label: "Medical Director (911)"

        /// <remarks/>
        [System.Xml.Serialization.XmlEnum("3")]
        Quality_Performance_Improvement_Specialist = 3, // Label: "QA Improvement Specialist (301)"

        /// <remarks/>
        [System.Xml.Serialization.XmlEnum("4")]
        Other = 4, // Label: "Other (701)"
    }

I run the proxy generator and I see the next code

import { mapEnumToOptions } from '@abp/ng.core';

export enum ContactType {
  NotSelected = 0,
  Administrative_Assistant  = 1,
  Medical_Director = 2,
  Quality_Performance_Improvement_Specialist = 3,
  Other = 4
}

export const contactTypeOptions = mapEnumToOptions(CustomDataType);

should i use [Description("My label HERE")]

also checking that I should include something like this on my localization { "culture": "en", "texts": { "Enum:ContactType.NotSelected": "Label here", "Enum:ContactType.Administrative_Assistant": "Label here", "Enum:ContactType.Medical_Director": "Label here", "Enum:ContactType.Quality_Performance_Improvement_Specialist": "Label here", "Enum:ContactType.Other": "Label here", } }

could you provide me a documentation or example related to complete implementation of this feature?

abp generate-proxy -t ng -m identity -u https://localhost:44388 --target identity-service --api-name Identity abp generate-proxy -t ng -m identityServer -u https://localhost:44388 --target identity-service --api-name Identity abp generate-proxy -t ng -m abp -u https://localhost:44388 --target identity-service --api-name Identity abp generate-proxy -t ng -m accountAdmin -u https://localhost:44388 --target identity-service --api-name Identity

68 प्रविष्टियों में 21 से 30 दिखा रहा है
Made with ❤️ on ABP v8.2.0-preview Updated on मार्च 25, 2024, 15:11