mirror of
https://github.com/D4M13N-D3V/comissions-app-core-api.git
synced 2025-03-14 10:04:55 +00:00
fix
This commit is contained in:
parent
d5ae99872d
commit
078488969e
@ -7,6 +7,6 @@ public class DiscoverySellerModel
|
|||||||
public List<string> SocialMediaLinks { get; set; }
|
public List<string> SocialMediaLinks { get; set; }
|
||||||
public string Biography { get; set; }
|
public string Biography { get; set; }
|
||||||
public bool PrepaymentRequired { get; set; }
|
public bool PrepaymentRequired { get; set; }
|
||||||
public double AverageRating { get; set; }
|
public double? AverageRating { get; set; }
|
||||||
public int ReviewCount { get; set; }
|
public int? ReviewCount { get; set; }
|
||||||
}
|
}
|
@ -17,6 +17,7 @@ public static class SellerProfileModelExtensions
|
|||||||
}
|
}
|
||||||
public static DiscoverySellerModel ToDiscoveryModel(this UserSellerProfile sellerProfile)
|
public static DiscoverySellerModel ToDiscoveryModel(this UserSellerProfile sellerProfile)
|
||||||
{
|
{
|
||||||
|
|
||||||
return new DiscoverySellerModel()
|
return new DiscoverySellerModel()
|
||||||
{
|
{
|
||||||
Name = sellerProfile.User.DisplayName,
|
Name = sellerProfile.User.DisplayName,
|
||||||
@ -24,8 +25,8 @@ public static class SellerProfileModelExtensions
|
|||||||
SocialMediaLinks = sellerProfile.SocialMediaLinks,
|
SocialMediaLinks = sellerProfile.SocialMediaLinks,
|
||||||
Biography = sellerProfile.Biography,
|
Biography = sellerProfile.Biography,
|
||||||
PrepaymentRequired = sellerProfile.PrepaymentRequired,
|
PrepaymentRequired = sellerProfile.PrepaymentRequired,
|
||||||
AverageRating = sellerProfile.SellerServices.Average(x=>x.Reviews.Average(y=>y.Rating)),
|
AverageRating = sellerProfile.SellerServices?.Average(x=>x.Reviews.Average(y=>y.Rating)),
|
||||||
ReviewCount = sellerProfile.SellerServices.Sum(x=>x.Reviews.Count)
|
ReviewCount = sellerProfile.SellerServices?.Sum(x=>x.Reviews.Count)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
public static UserSellerProfile ToModel(this SellerProfileModel sellerProfile, UserSellerProfile existingSellerProfile)
|
public static UserSellerProfile ToModel(this SellerProfileModel sellerProfile, UserSellerProfile existingSellerProfile)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user