Coder Social home page Coder Social logo

Comments (12)

ismcagdas avatar ismcagdas commented on May 27, 2024 1

@oguzhanagir can you look at this ?

from aspnetboilerplate.

aknaldemir avatar aknaldemir commented on May 27, 2024 1

I want to know where do I put this code in my project. it may be wrong.

Configuration.Modules.AbpAutoMapper().Configurators.Add(configuration => { ProductDtoMapper.CreateMappings(configuration, new MultiLingualMapContext( IocManager.Resolve<ISettingManager>() )); });

now like that;
public class lansmanApplicationModule : AbpModule
{
public override void PreInitialize()
{
Configuration.Authorization.Providers.Add();
//Configuration.BackgroundJobs.IsJobExecutionEnabled = false;

     Configuration.Notifications.Notifiers.Add<EmailRealTimeNotifier>();
     Configuration.Notifications.Notifiers.Add<SmsRealTimeNotifier>();
 }

 public override void Initialize()
 {
     var thisAssembly = typeof(lansmanApplicationModule).GetAssembly();

     IocManager.RegisterAssemblyByConvention(thisAssembly);

     Configuration.Modules.AbpAutoMapper().Configurators.Add(
         // Scan the assembly for classes which inherit from AutoMapper.Profile
         cfg => cfg.AddMaps(thisAssembly)
    
     );
     
     Configuration.Modules.AbpAutoMapper().Configurators.Add(configuration =>
     {
         ProductDtoMapper.CreateMappings(configuration, new MultiLingualMapContext(
             IocManager.Resolve<ISettingManager>()
         ));
     });

 }

}
in Application layer. Is this correct?

from aspnetboilerplate.

aknaldemir avatar aknaldemir commented on May 27, 2024 1

yes it is :))

from aspnetboilerplate.

aknaldemir avatar aknaldemir commented on May 27, 2024

Hii @oguzhanagir , were you able to look at this?

from aspnetboilerplate.

oguzhanagir avatar oguzhanagir commented on May 27, 2024

Hi @aknaldemir,

Here, the reason for Title and Description being null may stem from the inconsistency in the data in the relevant table of your database. When we tested the information you provided, we did not encounter such an issue.

from aspnetboilerplate.

aknaldemir avatar aknaldemir commented on May 27, 2024

here is my db side;

image

from aspnetboilerplate.

ismcagdas avatar ismcagdas commented on May 27, 2024

@aknaldemir you should remove Title and Description fields from the main entity. Localized fields must be in Translation entity only.

from aspnetboilerplate.

aknaldemir avatar aknaldemir commented on May 27, 2024

I removed but still same.

from aspnetboilerplate.

ismcagdas avatar ismcagdas commented on May 27, 2024

Could you provide a sample project ?

from aspnetboilerplate.

aknaldemir avatar aknaldemir commented on May 27, 2024

can we check step by step

from aspnetboilerplate.

aknaldemir avatar aknaldemir commented on May 27, 2024

Maybe ProductMapProfile is override above configuraiton?

public class ProductMapProfile : Profile
{
public ProductMapProfile()
{

    CreateMap<CreateProductDto, Product>()
    .ForMember(dest => dest.ProductImages, opt => opt.MapFrom(src => src.ProductImages))
    .ReverseMap();

    CreateMap<CreateProductImageDto, ProductImage>()
        .ReverseMap();

    //CreateMap<Product, GetAllProductWithImagesAndCommentDto>();
    CreateMap<Product, GetAllProductWithImageDto>();

    CreateMap<Product, GetProductDto>();
    //CreateMap<Product, GetProductByIdWithImagesAndCommentsDto>();
    CreateMap<Product, ListProductForAdminDto>();

    //CreateMap<ProductTranslation, ProductTranslationDto>()
    //    .ReverseMap();

}

}
internal static class ProductDtoMapper
{
public static void CreateMappings(IMapperConfigurationExpression configuration, MultiLingualMapContext context)
{
configuration.CreateMultiLingualMap<Product, ProductTranslation, GetAllProductWithImagesAndCommentDto>(context);
}
}

from aspnetboilerplate.

aknaldemir avatar aknaldemir commented on May 27, 2024

thanx for your time

from aspnetboilerplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.