Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6716689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:45:50+00:00 2026-05-26T08:45:50+00:00

I am using AutoMapper for mapping between my domain models and view models. My

  • 0

I am using AutoMapper for mapping between my domain models and view models. My web host only supports medium trust so AutoMapper will not work. Are there any other suggestions for good mappers like AutoMapper that can run in medium trust?

I don’t have access to IIS at the host.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:45:50+00:00Added an answer on May 26, 2026 at 8:45 am

    You can develope a simple mapper like this, if your model use properties with the same name:

    public static class Mapper {
    
            /// <summary>
            /// Copy all not null properties values of object source in object target if the properties are present.
            /// Use this method to copy only simple type properties, not collections.
            /// </summary>
            /// <param name="source">source object</param>
            /// <param name="target">target object</param>
            private static void SimpleCopy(object source, object target)
            {
                foreach (PropertyInfo pi in source.GetType().GetProperties())
                {
                    object propValue = pi.GetGetMethod().Invoke(source, null);
                    if (propValue != null)
                    {
                        try
                        {
                            PropertyInfo pit = GetTargetProperty(pi.Name, target);
                            if (pit != null) pit.GetSetMethod().Invoke(target, new object[] { propValue });
                        }
                        catch (Exception) { /* do nothing */ }
                    }
                }
            }
    
            private static PropertyInfo GetTargetProperty(string name, object target) 
            {
                foreach (PropertyInfo pi in target.GetType().GetProperties()) 
                {
                    if (pi.Name.Equals(name, StringComparison.CurrentCultureIgnoreCase)) return pi;
                }
                return null;
            }
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using AutoMapper to map domain entities to view models in an Asp.Net MVC
For the longest time I've been using AutoMapper to both map my domain models
I am using Automapper to convert between my EF4 Models and my ViewModels. Automapper
There are lots of tutorials for flattening domain models into DTO using AutoMapper. I
I am using AutoMapper to datareader using code as discussed below http://elegantcode.com/2009/10/16/mapping-from-idatareaderidatarecord-with-automapper/ I see
NOTE: The scenario is using 2 entity framework models to sync data between 2
hey guys, I'm using automapper version 1.1.0.188 In my AutoMapper.Configure I'm mapping Entities to
We are using AutoMapper extensively in our ASP.NET MVC web applications with the AutoMapViewResult
Using Automapper, how do you handle the mapping of a property value on an
I know it could be bad to use domain models as view models. If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.