本文整理汇总了C#中GenderType类的典型用法代码示例。如果您正苦于以下问题:C# GenderType类的具体用法?C# GenderType怎么用?C# GenderType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GenderType类属于命名空间,在下文中一共展示了GenderType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Product
protected Product(string name, string brand, decimal price, GenderType genderType)
{
this.Name = name;
this.Brand = brand;
this.Gender = genderType;
this.Price = price;
}
示例2: Driver
public Driver(string name, GenderType gender)
{
this.id = DataGenerator.GenerateId();
this.Name = name;
this.Gender = gender;
this.vehicles = new List<IMotorVehicle>();
}
示例3: CreateRawCompetitor
private static List<RawCompetitor> CreateRawCompetitor(string[] names, List<RawCompetitor> competitorsRaw, BrokerType brokerType, LanguageType languageType, SportType sportType, GenderType genderType)
{
var existNames = competitorsRaw.Select(cr => cr.Name).ToList();
names = names
.Where(name => !existNames.Contains(name))
.ToArray();
if (names.Any()) {
var lastCompetitorUniqueID = competitorsRaw.Any()
? competitorsRaw.First().CompetitoruniqueID
: default(int);
var raw = competitorsRaw;
names
.Where(name => !raw.Any(c => c.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)))
.Each(name => {
RawCompetitor competitorRaw = null;
try {
competitorRaw = BrokerEntityIfaceCreator.CreateEntity<RawCompetitor>(brokerType, languageType, sportType, genderType, LinkEntityStatus.Unlinked, new[] { name },
competitor => {
if (lastCompetitorUniqueID != default(int)) {
competitor.CompetitoruniqueID = lastCompetitorUniqueID;
competitor.Linkstatus = LinkEntityStatus.LinkByStatistics | LinkEntityStatus.Linked;
}
});
competitorRaw.Save();
raw.Add(competitorRaw);
} catch (Exception ex) {
_logger.Error("{0}\r\n{1}", competitorRaw?.ToString(), ex);
throw;
}
});
}
return competitorsRaw;
}
示例4: Toothpaste
public Toothpaste(string name, string brand, decimal price, GenderType gender, IList<string> ingredients)
: base(name, brand, price, gender)
{
this.IngredientsList = ingredients;
this.Ingredients = string.Join(", ", this.IngredientsList);
}
示例5: Shampoo
public Shampoo(string name, string brand, decimal price, GenderType gender, uint milliliters, UsageType usage)
: base(name, brand, price, gender)
{
this.Milliliters = milliliters;
this.Usage = usage;
this.Price *= this.Milliliters;
}
示例6: User
public User(string name, string password)
{
this.name = name;
this.password = password;
this.sex = GenderType.MALE;
this.chars = new Dictionary<byte, List<uint>>();
}
示例7: Product
protected Product(string name, string brand, decimal price, GenderType gender)
{
Name = name;
Brand = brand;
Price = price;
Gender = gender;
}
示例8: GetRawCompetitorInt
private static List<RawCompetitor> GetRawCompetitorInt(BrokerType brokerType, LanguageType languageType, SportType sportType, GenderType genderType, string[] names)
{
if (genderType == GenderType.Unknown) {
_logger.Error("{0}: {1}", names.StrJoin(", "), genderType);
}
var competitorsRaw = RawCompetitor.DataSource.FilterByLanguage(languageType).FilterBySportType(sportType).FilterByBroker(brokerType)
.FilterByNameCompetitor(names)
.FilterByGender(genderType,
RawCompetitor.Fields.CompetitoruniqueID,
RawCompetitor.Fields.Name,
RawCompetitor.Fields.Linkstatus);
if (competitorsRaw.Count > 1) {
var groupBy = competitorsRaw.Where(c => c.CompetitoruniqueID != default(int)).GroupBy(c => c.CompetitoruniqueID).ToArray();
if (groupBy.Length > 1) {
_logger.Error("{0} {1} {2} {3} {4} <=> {5}", brokerType, sportType, genderType,
competitorsRaw.Select(cr => cr.ID).StrJoin(", "), names.StrJoin(", "), groupBy.Select(g => g.Select(ge => ge.Name).StrJoin(", ")).StrJoin(" | "));
return groupBy.First().ToList();
}
if (groupBy.Length == 1) {
foreach (var rawCompetitor in competitorsRaw.Where(cr => cr.CompetitoruniqueID == default(int))) {
rawCompetitor.CompetitoruniqueID = groupBy[0].Key;
rawCompetitor.Save();
}
}
}
return CreateRawCompetitor(names, competitorsRaw, brokerType, languageType, sportType, genderType);
}
示例9: Honorific
public Honorific(string name, string abbreviation, GenderType genderType, HonorificType type)
{
Name = name;
Abbreviation = abbreviation;
GenderType = genderType;
Type = type;
}
示例10: Employee
public Employee(string employeeID,
string firstName,
string middleName,
string lastName,
string jobTitle,
GenderType gender,
MaritalStatusType maritalStatus,
DateTime birthDate,
DateTime hireDate,
string homePone,
string workPhone,
decimal salary,
Department department)
: base()
{
this.EmployeeID = employeeID;
this.FirstName = firstName;
this.LastName = lastName;
this.Gender = gender;
this.MaritalStatus = maritalStatus;
this.JobTitle = jobTitle;
this.BirthDate = birthDate;
this.HireDate = hireDate;
this.HomePhone = homePone;
this.WorkPhone = workPhone;
this.Salary = salary;
this.Department = department;
}
示例11: Driver
public Driver(string name, GenderType gender)
: base()
{
this.name = name;
this.gender = gender;
this.vehicles = new List<IMotorVehicle>();
}
示例12: Product
public Product(string name, string brand, decimal price, GenderType gender)
{
this.Name = name;
this.Brand = brand;
this.Price = price;
this.Gender = gender;
}
示例13: Toothpaste
public Toothpaste(string name, string brand, decimal price, GenderType gender, IList<string> ingredientsList)
:base(name, brand, price, gender)
{
this.ingredientList = ingredientsList;
ValidationListOfIngredients(ingredientsList);
}
示例14: ParseGenderType_ReturnsCorrectString
public void ParseGenderType_ReturnsCorrectString(GenderType genderType, string expected)
{
//act
var result = EnumFactory.ParseGenderType(genderType);
//assert
result.Should().Be(expected);
}
示例15: FirstName
/// <summary>
///
/// </summary>
/// <param name="genderType"></param>
/// <returns></returns>
public string FirstName(GenderType genderType = GenderType.Any)
{
var firstNames = _data.FirstNames.ToList();
if (genderType != GenderType.Any)
return Pick(firstNames.Where(x => x.GenderType == genderType).ToList()).Name;
return Pick(firstNames).Name;
}