コード例 #1
0
ファイル: MockModelValues.cs プロジェクト: formist/LinkMe
 public override MockModelValues Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new MockModelValues
     {
         NullStringValue = values.GetStringValue("NullStringValue"),
         NotNullStringValue = values.GetStringValue("NotNullStringValue"),
         NullStringArrayValue = values.GetStringArrayValue("NullStringArrayValue"),
         NotNullStringArrayValue = values.GetStringArrayValue("NotNullStringArrayValue"),
         NullBoolValue = values.GetBooleanValue("NullBoolValue"),
         NotNullBoolValue = values.GetBooleanValue("NotNullBoolValue"),
         BoolValue = values.GetBooleanValue("BoolValue") ?? false,
         NullIntValue = values.GetIntValue("NullIntValue"),
         NotNullIntValue = values.GetIntValue("NotNullIntValue"),
         IntValue = values.GetIntValue("IntValue") ?? 0,
         NullDecimalValue = values.GetDecimalValue("NullDecimalValue"),
         NotNullDecimalValue = values.GetDecimalValue("NotNullDecimalValue"),
         DecimalValue = values.GetDecimalValue("DecimalValue") ?? 0,
         NullGuidValue = values.GetGuidValue("NullGuidValue"),
         NotNullGuidValue = values.GetGuidValue("NotNullGuidValue"),
         GuidValue = values.GetGuidValue("GuidValue") ?? Guid.Empty,
         NullGuidArrayValue = values.GetGuidArrayValue("NullGuidArrayValue"),
         NotNullGuidArrayValue = values.GetGuidArrayValue("NotNullGuidArrayValue"),
         NullDateTimeValue = values.GetDateTimeValue("NullDateTimeValue"),
         NotNullDateTimeValue = values.GetDateTimeValue("NotNullDateTimeValue"),
         NullPartialDateValue = values.GetPartialDateValue("NullPartialDateValue"),
         NotNullPartialDateValue = values.GetPartialDateValue("NotNullPartialDateValue"),
         EnumValue = values.GetValue <EnumValue>("EnumValue") ?? EnumValue.No,
         NullEnumValue = values.GetValue <EnumValue>("NullEnumValue"),
         NotNullEnumValue = values.GetValue <EnumValue>("NotNullEnumValue"),
         EnumFlagsValue = values.GetFlagsValue <EnumFlagsValue1>() ?? EnumFlagsValue1.None,
         NullEnumFlagsValue = values.GetFlagsValue <EnumFlagsValue2>(),
         NotNullEnumFlagsValue = values.GetFlagsValue <EnumFlagsValue3>(),
     });
 }
コード例 #2
0
        public override ResourceSearchCriteria Deconvert(IGetValues values, IDeconverterErrors errors)
        {
            var criteria = new ResourceSearchCriteria();

            DeconvertSortOrder(criteria, values, errors);

            criteria.Keywords      = values.GetStringValue(ResourceSearchCriteriaKeys.Keywords);
            criteria.CategoryId    = values.GetGuidValue(ResourceSearchCriteriaKeys.CategoryId);
            criteria.SubcategoryId = values.GetGuidValue(ResourceSearchCriteriaKeys.SubcategoryId);
            criteria.ResourceType  = values.GetValue <ResourceType>(ResourceSearchCriteriaKeys.ResourceType) ?? ResourceSearchCriteria.DefaultResourceType;

            return(criteria);
        }
コード例 #3
0
 public override EducationUpdateModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new EducationUpdateModel
     {
         HighestEducationLevel = values.GetValue <EducationLevel>(EducationKeys.HighestEducationLevel),
         School = new SchoolModel
         {
             Id = values.GetGuidValue(EducationKeys.Id),
             City = values.GetStringValue(EducationKeys.City),
             EndDate = new PartialDateConverter(false).Deconvert(EducationKeys.EndDate, values),
             IsCurrent = values.GetBooleanValue(EducationKeys.IsCurrent),
             Description = values.GetStringValue(EducationKeys.Description),
             Institution = values.GetStringValue(EducationKeys.Institution),
             Major = values.GetStringValue(EducationKeys.Major),
             Degree = values.GetStringValue(EducationKeys.Degree),
         }
     });
 }
コード例 #4
0
 public override EmploymentHistoryUpdateModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new EmploymentHistoryUpdateModel
     {
         RecentProfession = values.GetValue <Profession>(EmploymentHistoryKeys.RecentProfession),
         RecentSeniority = values.GetValue <Seniority>(EmploymentHistoryKeys.RecentSeniority),
         IndustryIds = values.GetGuidArrayValue(EmploymentHistoryKeys.IndustryIds),
         Job = new JobModel
         {
             Id = values.GetGuidValue(EmploymentHistoryKeys.Id),
             Company = values.GetStringValue(EmploymentHistoryKeys.Company),
             Title = values.GetStringValue(EmploymentHistoryKeys.Title),
             Description = values.GetStringValue(EmploymentHistoryKeys.Description),
             StartDate = new PartialDateConverter(false).Deconvert(EmploymentHistoryKeys.StartDate, values),
             EndDate = new PartialDateConverter(false).Deconvert(EmploymentHistoryKeys.EndDate, values),
             IsCurrent = values.GetBooleanValue(EmploymentHistoryKeys.IsCurrent),
         },
     });
 }
コード例 #5
0
 public override CandidateModel Deconvert(IGetValues values, IDeconverterErrors errors)
 {
     return(new CandidateModel
     {
         Id = values.GetGuidValue("Id").Value,
         CanContact = values.GetValue <CanContactStatus>("CanContact").Value,
         CanContactByPhone = values.GetValue <CanContactStatus>("CanContactByPhone").Value,
         HasBeenViewed = values.GetBooleanValue("HasBeenViewed").Value,
         HasBeenAccessed = values.GetBooleanValue("HasBeenAccessed").Value,
         IsInMobileFolder = values.GetBooleanValue("IsInMobileFolder").Value,
         FullName = values.GetStringValue("FullName"),
         PhoneNumbers = values.GetStringArrayValue("PhoneNumbers"),
         Status = values.GetValue <CandidateStatus>("Status").Value,
         LastUpdatedTime = values.GetDateTimeValue("LastUpdatedTime"),
         Location = values.GetStringValue("Location"),
         DesiredJobTitle = values.GetStringValue("DesiredJobTitle"),
         DesiredJobTypes = values.GetFlagsValue <JobTypes>() ?? JobTypes.None,
         Summary = values.GetStringValue("Summary"),
         DesiredSalary = values.GetChildValue <SalaryModel>("DesiredSalary"),
         Jobs = values.GetArrayValue <JobModel>("Jobs"),
     });
 }
コード例 #6
0
 private static void DeconvertCommunity(JobAdSearchCriteria criteria, IGetValues values)
 {
     criteria.CommunityId = values.GetGuidValue(JobAdSearchCriteriaKeys.CommunityId);
 }