User avatar
Amber neodog_box @puppygirlhornypost2@transfem.social
1y
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;
    }
2
0
1
0
User avatar
Amber neodog_box @puppygirlhornypost2@transfem.social
1y
and i will map by hand. can't stop me.
1
0
0
0
User avatar
The Eldritch Rain Eldritchness @rain@an.eldritch.gift
1y
@puppygirlhornypost2 This is the way! blobcatcool One should not have to deal with Automapper's "Hey btw I'm failing and I'm not telling you why" BS.

0
0
0
0