public static DataCollectionViewModelStep1 MapFrom(this DataCollectionViewModelStep1 vm, Project project, DataCollection collection = null)
 {
     if (vm == null || project == null)
     {
         return(vm);
     }
     if (collection != null)
     {
         vm.InjectFrom(collection);
     }
     vm.ProjectTitle = project.Title;
     return(vm);
 }
        public static DataCollection MapFrom(this DataCollection entity, DataCollectionViewModelStep1 vm)
        {
            if (vm == null || entity == null)
            {
                return(entity);
            }

            string[] exclusions = entity.IsFirstCollection ? new[] { "DataStoreLocationName", "DataStoreLocationUrl", "IsFirstCollection" } : new string[] {};
            var      injection  = new SameNameWithRecursion(exclusions);

            entity.InjectFrom(injection, vm);
            return(entity);
        }