Closed Siratigui closed 2 years ago
In 22.1.302 version
please send a PR where u have tessted your suggestions and they work for you and happy to send a build.
thanks for the understanding and help
@vimarx since you also affected after @Siratigui PR could you also update us if his changes work for u for #939
It will take so much time for me to create a sample because the project is very customized. I think that you can face this error in any WorldCreator project.
I do not want a sample, as I understand you modified the source right? can u push a PR with those modifications?
nevermind just wanted you to take the credits for the fix, easier to do it myself. anyways feel free to PR any futures changes.
thnks again pushin in lab now
i do not see how it relates with #939 maybe I missunderstood?
when opening the ModelDifference DetailView the expression application.GetFieldValue("objectSpaceProviders") is executed somewhere. application.GetFieldValue("objectSpaceProviders") is not valid anymore. you may change it anywhere it is called in the codes i guess.
can u test in your WC code that this method works
public static IEnumerable<IObjectSpaceProvider> AddObjectSpaceProvider(this XafApplication application, params IObjectSpaceProvider[] providers)
=> ((IList<IObjectSpaceProvider>)application.CallMethod("GetOrCreateObjectSpaceProviderContainer").GetFieldValue("_objectSpaceProviders")).AddRange(providers);
AddRange
can be used from the Xpand.Extensions.XAF.XafApplicationExtensions
namespace therefore the Xpand.Extensions.XAF
I want to use that method instead
eXpand.lab release 22.1.302.1 includes commit that relate to this task:
Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.
To minimize version conflicts we recommend that you switch to PackageReference format and use only the eXpandAgnostic, eXpandWin, eXpandWeb packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).
Thanks a lot for your contribution.
AddRange can be used from the Xpand.Extensions.XAF.XafApplicationExtensions namespace therefore the Xpand.Extensions.XAF
or simply if u do not have dependecies is like this
public static partial class LinqExtensions{
public static T[] AddRange<T>(this IEnumerable<T> source,IEnumerable<T> enumerable,bool ignoreDuplicates=false)
=> source is IList<T> list
? enumerable.Where(arg => !ignoreDuplicates || !source.Contains(arg)).Execute(list.Add).ToArray()
: source.AddToArray(enumerable, ignoreDuplicates);
public static void Add(this IList source, object item, bool ignoreDuplicates=false) {
if (!ignoreDuplicates || !source.Contains(item)) {
source.Add(item);
}
}
public static T[] AddToArray<T>(this IEnumerable<T> source, T item, bool ignoreDuplicates = false) {
var enumerable = source as T[] ?? source.ToArray();
return !ignoreDuplicates && enumerable.Any(arg => arg.Equals(item))
? enumerable : enumerable.Concat(item.YieldItem()).ToArray();
}
public static T[] AddToArray<T>(this IEnumerable<T> source, IEnumerable<T> items, bool ignoreDuplicates = false)
=> items.SelectMany(arg => source.AddToArray(arg, ignoreDuplicates)).ToArray();
public static T Add<T>(this IList<T> source, T item, bool ignoreDuplicates = false) {
if (!ignoreDuplicates || !source.Contains(item)) {
source.Add(item);
return item;
}
return default;
}
}
I tried the release in lab. I still get the same error when trying to open the modeldifference detailview due the xafApplication.GetFieldValue("objectSpaceProviders") in the picture above.
can you please change it wherever it is used.
this release was send before your suggestion to replace everything and apparently we need one method to rule them all and not search and replace the universe so that why i asked what I asked previoslt
public static IEnumerable<IObjectSpaceProvider> AddObjectSpaceProvider(this XafApplication application, params IObjectSpaceProvider[] providers) => ((IList<IObjectSpaceProvider>)application.CallMethod("GetOrCreateObjectSpaceProviderContainer").GetFieldValue("_objectSpaceProviders")).AddRange(providers);
I tested the method it works.
cool I need to push both repositories though as thi is going to live in Xpand.XAF.Extensions package of the RX repositories. So give me 1 day or 2 there are works in progress in the RX repo
The pre-release 4.221.1.0 in the Reactive.XAF lab
branch includes commits that relate to this task:
To minimize version conflicts we recommend that you use the Xpand.XAF.Core.All, Xpand.XAF.Win.All, Xpand.XAF.Web.All packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).
Please update the related Nuget packages and test if issues is addressed. These are nightly nuget packages available only from our NugetServer.
If you do not use these packages directly but through a module of the main eXpandFramework project, please wait for the bot to notify you again when integration is finished or update the related packages manually.
Thanks a lot for your contribution.
eXpand.lab release 22.1.302.2 includes commit that relate to this task:
Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.
To minimize version conflicts we recommend that you switch to PackageReference format and use only the eXpandAgnostic, eXpandWin, eXpandWeb packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).
Thanks a lot for your contribution.
eXpand.lab release 22.2.400.0 includes commit that relate to this task:
Please test if it addresses the problem. If you use nuget add our LAB NugetServer as a nuget package source in VS.
To minimize version conflicts we recommend that you switch to PackageReference format and use only the eXpandAgnostic, eXpandWin, eXpandWeb packages. Doing so, all packages will be at your disposal and .NET will add a dependecy only to those packages that you actually use and not to all (see the Modules installation-registrations youtube video).
Thanks a lot for your contribution.
Hi,
objectSpaceProviders access has been changed by DevExpress.
application.GetFieldValue("objectSpaceProviders") is not longer working.
Now can not open the model because it can not find objectSpaceProviders.
You can access now access it from: application.GetFieldValue("_objectSpaceProviderContainer").GetFieldValue("_objectSpaceProviders")
I faced this error in WorldCreator and solved it by changing:
and
and