displayname localization from different assembly (not referenced)

34 Views Asked by At

i'm making a website in mvc5 with a referenced project/dll "core" where i've all business logic, repos, mapping etc etc

i want to add resx for localization of viewModel's properties i need to put in inside website right? (or is possible from referenced dll? ) for me is very useful to have viewModel classes inside core project (referenced by website)

is it possible to assign displayAttribute.ResourceType from core project!? (i've resource in website which is not referenced , to avoid circular ref...)

i'm trying something "dynamic" like this code: but having compilation error " An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type "

namespace Core.Model.ViewModels.Stats
{
    public class ItemVM
    { 
        public long Id { get; set; }

        [Display(Name = "ItemVM_Name", ResourceType = Type.GetType("WebSite.Translation.ViewModels"))]
        public string Name { get; set; }
        ...
     }
}
1

There are 1 best solutions below

0
On

solved...

just moved resx into "core" library (as public items) website can handle them