Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

.Net Core Model Localization How to be the key from Resource File

$
0
0

Hello,

I have a question about DataAnnotations Localization for Models in .NET Core 1.1 : I can't understand how to put the Key and Value in the Resource File .

For Example I have a Title Annotation in Model and I have a resource file named: Models.AdminViewModels.DepartmentViewModel.fr-FR.resx  .

I tried to insert a keys like : ErrorMessage, Title, TitleRequired, etc, but nothing is working .

namespace PL.Models.AdminViewModels{publicclassDepartmentViewModel{[Required(ErrorMessage="Title Required")]publicstringTitle{get;set;}}}

Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>