firm hater of automapper. real C# code made by me internal void Update(ModelMeta model)
{
Meta meta = new Meta()
{
MaintainerName = model.MaintainerName,
MaintainerEmail = model.MaintainerEmail,
Version = model.Version,
ProvidesTarball = model.ProvidesTarball,
Name = model.Name,
ShortName = model.ShortName,
Url = model.Url,
Description = model.Description,
langs = (model.Langs != null && model.Langs.Length != 0)
? ImmutableArray.Create<string>(model.Langs)
: ImmutableArray<string>.Empty,
DefaultDarkTheme = model.DefaultDarkTheme,
DefaultLightTheme = model.DefaultLightTheme,
DefaultLike = model.DefaultLike,
RegistrationDisabled = model.RegistrationDisabled,
SignupEmailRequired = model.SignupEmailRequired,
SignupApprovalRequired = model.SignupApprovalRequired,
CaptchaProviders = new CaptchaProviders()
{
EnableHCaptcha = model.EnableHCaptcha,
HCaptchaSiteKey = model.HCaptchaSiteKey,
EnableMCaptcha = model.EnableMCaptcha,
MCaptchaSiteKey = model.MCaptchaSiteKey,
MCaptchaInstanceUrl = model.MCaptchaInstanceUrl,
EnableReCaptcha = model.EnableReCaptcha,
ReCaptchaSiteKey = model.ReCaptchaSiteKey,
EnableTurnstile = model.EnableTurnstile,
TurnstileSiteKey = model.TurnstileSiteKey
},
InstanceUrls = new InstanceUrls()
{
TosUrl = model.TosUrl,
RepositoryUrl = model.RepositoryUrl,
FeedbackUrl = model.FeedbackUrl,
DonationUrl = model.DonationUrl,
MascotImageUrl = model.MascotImageUrl,
BannerUrl = model.BannerUrl,
ServerErrorImageUrl = model.ServerErrorImageUrl,
InfoImageUrl = model.InfoImageUrl,
NotFoundImageUrl = model.NotFoundImageUrl,
IconUrl = model.IconUrl,
BackgroundImageUrl = model.BackgroundImageUrl,
ImpressumUrl = model.ImpressumUrl,
LogoImageUrl = model.LogoImageUrl,
PrivacyPolicyUrl = model.PrivacyPolicyUrl,
InquiryUrl = model.InquiryUrl
},
EnableAchievements = model.EnableAchievements,
SwPublicKey = model.SwPublicKey,
MaxNoteLength = model.MaxNoteLength,
NotesPerAd = model.NotesPerAd,
EnableEmail = model.EnableEmail,
EnableServiceWorker = model.EnableServiceWorker,
TranslatorAvailable = model.TranslatorAvailable,
MediaProxy = model.MediaProxy,
rules = (model.Rules != null && model.Rules.Length != 0)
? ImmutableArray.Create<string>(model.Rules)
: ImmutableArray<string>.Empty,
ThemeColor = model.ThemeColor
};
Meta = meta;
}