Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Greg Woods 12 posts 92 karma points
    Jun 20, 2018 @ 05:16
    Greg Woods
    0

    Fluidity using Guid for Id instead of int

    I'm sure this is probably an easy one but I've tried my first code sample using Fluidity and decide to make it harder for myself and swap out the int Id (from the getting started doc) to a uniqueidentifier.

    I used this to set the Guid but I keep getting an error thrown, as below.

                                    tabConfig.AddField(p => p.Id).MakeReadonly().SetDefaultValue(Guid.NewGuid);
    

    Also haven't been able to get there yet but not sure this will work for editing as well as updating e.g. need to add a if (p.Id != null)

    System.NullReferenceException: Object reference not set to an instance of an object.

    at Fluidity.Web.Trees.FluidityTreeController.GetTreeNode(String id, FormDataCollection queryStrings) at lambdamethod(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>cDisplayClass10.9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker._1.MoveNext()

    Also this is the url that get's set after Save which looks a bit weird: http://localhost:85/umbraco/#/database/fluidity/edit/location!00000000-0000-0000-0000-000000000000

Please Sign in or register to post replies

Write your reply to:

Draft