Exemple #1
0
        private IEnumerable <string> GetStrings()
        {
            yield return($"{nameof(Ethnicity).ToLower()}={ethnicity.ToString().ToLower()}");

            yield return($"{nameof(Gender).ToLower()}={gender.ToString().ToLower()}");

            yield return($"{nameof(Age).ToLower()}={age.ToString().ToLower().Replace("_", "-")}");
        }
Exemple #2
0
        public JsonNetResult Name(int id)
        {
            Ethnicity ethnicity = this.personTasks.GetEthnicity(id);

            if (ethnicity != null)
            {
                return(JsonNet(new
                {
                    Id = id,
                    Name = ethnicity.ToString()
                }));
            }
            else
            {
                return(JsonNet(string.Empty));
            }
        }