Skip to content

Commit

Permalink
ADMINAPI | AdminApiMapping fix (#66)
Browse files Browse the repository at this point in the history
Co-authored-by: Luis Chavarriaga <[email protected]>
  • Loading branch information
stephenfuqua and lchavarriaga authored Jun 19, 2023
1 parent 2b764b0 commit b6dbe59
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ApplicationModel
public string? ApplicationName { get; set; }
public string? ClaimSetName { get; set; }
public string? ProfileName { get; set; }
public int EducationOrganizationId { get; set; }
public int? EducationOrganizationId { get; set; }
public string? OdsInstanceName { get; set; }
public int? VendorId { get; set; }
public IList<Profile>? Profiles { get; set; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public AdminApiMappingProfile()
.ForMember(dst => dst.NamespacePrefixes, opt => opt.MapFrom(src => src.VendorNamespacePrefixes.ToCommaSeparated()));

CreateMap<Application, ApplicationModel>()
.ForMember(dst => dst.EducationOrganizationId, opt => opt.MapFrom(src => src.ApplicationEducationOrganizations.First().EducationOrganizationId))
.ForMember(dst => dst.EducationOrganizationId, opt => opt.MapFrom(src => src.EducationOrganizationId()))
.ForMember(dst => dst.ProfileName, opt => opt.MapFrom(src => src.ProfileName()))
.ForMember(dst => dst.VendorId, opt => opt.MapFrom(src => src.VendorId()))
.ForMember(dst => dst.Profiles, opt => opt.MapFrom(src => src.Profiles()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ public static IList<Profile> Profiles(this Application application)
{
return application?.Vendor?.VendorId;
}

public static int? EducationOrganizationId(this Application application)
{
return application?.ApplicationEducationOrganizations?.FirstOrDefault()?.EducationOrganizationId;
}
}

0 comments on commit b6dbe59

Please sign in to comment.