Пример #1
0
        public static void ThrowIfNotModelWithAttributeRoutes(this ActionModel actionModel, ILocalizer localizer)
        {
            actionModel.ThrowIfNotOriginalModel(localizer);

            if (!actionModel.HasAttributeRoutes())
            {
                throw new ArgumentException("ActionModel with AttributeRoutes was expected.");
            }
        }
 public static bool IsPartiallyTranslatedAction(ActionModel action, ICollection <string> cultures, ILocalizer localizer)
 {
     return(action.HasAttributeRoutes() &&
            cultures.All(
                culture => action.TryGetLocalizedModelFor(localizer, culture)?.IsPartiallyTranslated(localizer) == true));
 }
 public static bool IsNotCompletelyTranslatedAction(ActionModel action, string culture, ILocalizer localizer)
 {
     return(action.HasAttributeRoutes() && action.TryGetLocalizedModelFor(localizer, culture)
            ?.IsCompletelyTranslated(localizer) != true);
 }