Esempio n. 1
0
		private void createNames(string name)
		{
			Name = name;
			var pluralizer = new EnglishPluralizationService();
			PluralName = pluralizer.Pluralize(Name);
			CamelCaseName = Name.Substring(0, 1).ToLower() + Name.Substring(1);
			MessageName = string.Format("{0}Message", Name);
			DetailName = string.Format("{0}MessageDetail", Name);
			
		}
        public void Pluralize_userdictionary_override_default_rules()
        {
            var entries = new[]
                              {
                                  new CustomPluralizationEntry(singular: "X", plural: "Z")
                              };
            var pluralizationService = new EnglishPluralizationService(entries);

            Assert.Equal("Z", pluralizationService.Pluralize("X"));
        }
        private DbsetCandidate[] GetCandidateList(CodeClass2 selectedBase)
        {
            try {
                var descendants = new List<CodeClass2>();
                _projectItem.Project.TraverseHierarchyForCodeElements<CodeClass2>(descendants.Add,
                   x => x != selectedBase
                       && x.IsDerivedFrom[selectedBase.FullName]);

                var pluralizationService = new EnglishPluralizationService();

                var items = from c in descendants
                            select
                                new DbsetCandidate() {
                                    Class = c,
                                    IsAlreadyDefined = _existingSets.Contains(c.FullName),
                                    SetName = pluralizationService.Pluralize(c.Name)
                                };

                return items.ToArray();;
            }
            catch (Exception e) {
                Debug.DebugHere(e);
                throw;
            }
        }
Esempio n. 4
0
		protected TypedCodeFile(ProjectFacade project, TypeFacade type) : base(project)
		{
			Type = type;
			var pluralizer = new EnglishPluralizationService();
			if (type != null)
			{
				Name = type.Name;
				PluralName = pluralizer.Pluralize(Name);
			}
		}