Coder Social home page Coder Social logo

cslaforum's People

Contributors

gitter-badger avatar rockfordlhotka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cslaforum's Issues

Csla and MVC

Hello

With my csla/silverlight apps needing to be rebuilt I have decided reluctantly to redo using the html/mvc/javascript stack as they say.

[Does anyone know what will actually happen in 2021 btw re Silverlight apps - just stop working, just not supported but will carry on for 2,3,5 or more years???]

I have little/no mvc experience.

  1. Is Csla still a good fit for this (MVC6/Web Api)?

  2. If so, I have a number of questions having taken a look at the CslaMVC sample app

a) Can mvc/csla pass typical clsa objects to and from view and Controller (and can these objects [properties] be binded?)?
b) Can mvc/csla pass typical clsa objects to and from View via ajx calls (and can these objects [properties] be binded?)?
c) Can we utilise the embedded validation in csla objects etc. in the View?

If the answers are yes to the above do I still need to consider using, for example, knockout or angular, as if csla objects bind and can be transferred to and from Views/Controllers what is the need for Knockout to do the binding?

Is the e-book Csla/MVC still relevant for MVC6 (web api) etc?

Does anyone have a more advanced example sample app using Csla/MVC (third-party grid controls - DevExpress, Kendo etc) that they are willing to share?

Many thanks in advance for your responses.

Richard

BrokenRulesCollection Not Working on Parent even though it Works on Child

This is probably something very easy but since this is my first project with CSLA.NET I'm sure I'm doing something wrong :)

I have an parent object

Complaint : BusinessBase

and a child property defined as

private static readonly PropertyInfo claimantProperty = RegisterProperty(c => c.Claimant, RelationshipTypes.Child);

When I set a FirstName property to invalid data on the Claimant object, the BrokenRulesCollection on that object (Complaint.Claimant.BrokenRulesCollection) has a count of 3 and has all my business rules that are broken as expected. However, if I look at Complaint.BrokenRulesCollection it is empty? Why? I thought from reading the eBooks that if I defined the relationship as a child, the parent would contain all broken rules? Am I missing something?

Thanks for any assistance.

Mark

Disconnected data?

I haven't used CSLA before, still trying to learn what it is (and isn't). Does CSLA has any facility/provision/concept of a transient connection to data access? I'm thinking about scenarios where the network may have a quick disconnect/reconnect cycle (like wireless/cellular roaming), and also longer disconnected periods where activity may need to be stored locally and forwarded/sync'd later?

Support for Slack (collaboration)

I've been playing with Slack for a while now and have a community set up that is tied to this GitHub forum.

One of the drawbacks to this forum is that there's no notification scheme - no way to know when someone has posted a new item or reply.

Slack is one way to solve this issue, because it echoes this forum, and Slack has mobile (and desktop) clients that support notifications.

If you are interested in helping me with the next stage of Slack experimentation I'll need your email address - sadly I need to manually add people to Slack unless they are part of my domain (and of course you aren't ๐Ÿ˜„).

Mobile Object pattern questions

Hi, I'm new to CSLA. I'm reading the source code and Rockford's blog to understand the framework, but I have a two questions related to the DataPortal and the Mobile Object pattern:

1)Do NetDataContractSerializer and MobileFormatter treat objects as references? I mean, If I have several references to an object in an object graph, only one copy of the object is serialized, deserialized and referenced at the other endpoint?

2)Can an endpoint exposed outside the firewall use the Mobile Object pattern or it has to be SOA?
For example, the UI tier, a WPF or smartphone app running outside the firewall, exchanging data with an WCF service. Can we trust the data that the WCF Service is receiving?
I don't think so. An individual could send invalid data to the server modifying the client app or without even using the client app. Validation has to happen at both sides.
The WCF service can't trust in the object graph that the UI tier is sending. For example, an "Order" is related to a "Customer", the Customer sent by the client could have incorrect data to break the system. The server has to get the Customer again from the database.
Other example is the original state of objects. The server should get the original state from the database and merge it with the new state that the client is sending.

So, in this case tiers could share the implementation of the business objects, but they can't use the Mobile Object pattern to communicate, they have to use SOA to enforce the trust boundary and reconstruct the objects manually. Is this the recommended practice when the UI tier outside the firewall?

Thanks.

Speedup EditableRootList

Hi!
I have an EditableRootList with about 1500 ChildObjects in it.
The call of Child_Upate() takes more than 30 seconds of time.
Even if i had only one Child to Change (Checked in Update from the Childs)
Any Suggestions ?
Thank you for an answer !
Thilo

We are using CSLA Version 4.5.601

Trying to use Xamarin iOS with CSLA 4.5.7

I am getting an issue trying to login with this error coming back:
{System.InvalidOperationException: Type GenericPrincipal must implement IMobileObject
at Csla.Serialization.Mobile.MobileFormatter.SerializeObject (System.Object obj) [0x00082] in :0
at Csla.Serialization.Mobile.MobileFormatter.SerializeAsDTO (System.Object graph) [0x0000b] in :0
at Csla.Serialization.Mobile.MobileFormatter.SerializeToDTO (System.Object obj) [0x00006] in :0
at Csla.Serialization.Mobile.MobileFormatter.Serialize (System.IO.Stream serializationStream, System.Object graph) [0x00006] in :0
at Csla.Serialization.Mobile.MobileFormatter.Serialize (System.Object obj) [0x0000c] in :0
at Csla.DataPortalClient.WcfProxy.GetBaseCriteriaRequest () [0x00052] in :0
at Csla.DataPortalClient.WcfProxy+d__c.MoveNext () [0x0002c] in :0

I have Xamarin Android, Silverlight, PC all fine and working without fail. When I try to login under iOS It throws that Type GenericPrincipal must implement IMobileObject. Am I missing something? BTW We cannot update to the latest alpha because we still need to support Silverlight.

Thanks!
Brad

Server-side (DataPortal Host) caching of business objects

I'm looking to add some Business Object caching on the server side of our application which is currently using a 2-tier model with the server-side hosted within Azure.

I've been reading various forum posts and also looking at the CslaContrib repo but nothing seems to suit my needs. The CslaContrib appears to be client-side caching (Although I may be wrong but CacheDataPortal seems to be implementing IDataPortalProxy - I suppose greater than 2-tier might be able to utilise this)

Ideally what I would like to do is intercept calls on the server side, after IAuthorizeDataPortal, and implement a caching layer (to utilise an Azure Redis cache) but there appears to be no way to do this.

From what I can see my only options are either:

  1. Implement my own Hosts.IWcfPortal (or subclass Hosts.WcfPortal) ensuring I make the IAuthorizeDataPortal myself and then delegating off to a caching layer which eventually would call Server.DataPortal (as per Hosts.WcfPortal does) when there is a cache-miss.
  2. Implement DataPortal_OnDataPortalInvoke (or similar) on each business object (or on a base) and copy over cached data from a cached BO the currently instantiated "shell" object.
  3. Implement caching at a Data Access level instead.

Does anyone have any suggestions for how I can achieve what I would like to do?

Basic Loading Children Question (CSLA.NET v4.0.30319)

I have my first application in progress using CSLA.NET and I thought I had a good handle on the basics of loading children but I have strange bug happening where somehow the DataPortal_Update is being called even though I don't call the save method any where in my code yet.

Anyway, I think the first issue is that when I retrieve my parent and load the first child, the object goes to an IsDirty state of true. My understanding is that I need to call the DataPortal.CreateChild method to create all children and I thought I read in the eBooks that doing this would not mark my object as dirty. However here is my code for the my parent object and you can see when the line this.Claimant = DataPortal.CreateChild(); executes isdirty becomes true. So my question is how to tell the parent that I just loaded from the database and everything is in sync? I tried Markold(); but that did not seem to change the flags and besides I thought that wasn't necessary.

I have a parent object (Complaints) created during a fetch like this
private void DataPortal_Fetch()
{
// get all the compliants methods from the database.
TComplaints complaints = TComplaint.SelectAll();

        if (complaints != null)
        {
            foreach (var item in complaints)
            {

                this.Add(DataPortal.Fetch<Complaint>(item));
            }
        }

        complaints = null;  //cleanup
    }

In the Fetch of an individual Complaint object I have this:

    private void DataPortal_Fetch(TComplaint data)
    {
        using (BypassPropertyChecks)
        {
            this.DateReceived = data.DateReceived;

            // -->> AT THIS POINT IF I CHECK THE OBJECT IT IS NOT DIRTY (IsDirty = false)

            this.Claimant = DataPortal.CreateChild<Claimant>();  create child not overridden just using default

            // -->> AT THIS POINT IF I CHECK THE OBJECT IT IS DIRTY (IsDirty = true)

          }
    }

BusinessRules not executed.

Here's my code. In my BusinessObject, I set the Door propertie. It loads my 2 default color and then their BaseUnitPriceProperties with businessRules. My Glazing property is set by a businessRule when the Door is changes and then the GlazingBaseUnitPrice. The Glass property is changed by the Glazing
with another Rules, but the Rules that changes the GlassBaseUnitPrice is never called when setting the Door property. Only when I manually call the Setter of the Glazing property. Why?? It seems that only 2 layers of Rules are executed. Here's my code.

using Csla;
using Csla.Core;
using Csla.Rules;
using Csla.Rules.CommonRules;
using PortesDecko.BusinessObjects.MF_MasterFile;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace PortesDecko.BusinessObjects.SO_SalesOrder
{
[Serializable]
public class DoorDetail : Base.CORE.BusinessObjects.CustomBusinessBase
{
public DoorDetail() : base() { /* Require use of factory methods */ }

    #region Properties

    #region Root Properties

    public static readonly PropertyInfo<MF_Product.LightBusinessObjects.viewProductDoor> DoorProperty = RegisterProperty<MF_Product.LightBusinessObjects.viewProductDoor>(c => c.Door);
    public MF_Product.LightBusinessObjects.viewProductDoor Door
    {
        get { return GetProperty(DoorProperty); }
        set { SetProperty(DoorProperty, value); }
    }

    public static readonly PropertyInfo<decimal?> DoorBaseUnitPriceProperty = RegisterProperty<decimal?>(c => c.DoorBaseUnitPrice);
    public decimal? DoorBaseUnitPrice
    {
        get { return GetProperty(DoorBaseUnitPriceProperty); }
        set { SetProperty(DoorBaseUnitPriceProperty, value); }
    }

    public static readonly PropertyInfo<MF_MasterFile.LightBusinessObjects.Dimension> DoorHeightDimensionProperty = RegisterProperty<MF_MasterFile.LightBusinessObjects.Dimension>(c => c.DoorHeightDimension);
    public MF_MasterFile.LightBusinessObjects.Dimension DoorHeightDimension
    {
        get { return GetProperty(DoorHeightDimensionProperty); }
        set { SetProperty(DoorHeightDimensionProperty, value); }
    }

    public static readonly PropertyInfo<MF_MasterFile.LightBusinessObjects.Dimension> DoorWidthDimensionProperty = RegisterProperty<MF_MasterFile.LightBusinessObjects.Dimension>(c => c.DoorWidthDimension);
    public MF_MasterFile.LightBusinessObjects.Dimension DoorWidthDimension
    {
        get { return GetProperty(DoorWidthDimensionProperty); }
        set { SetProperty(DoorWidthDimensionProperty, value); }
    }

    public static readonly PropertyInfo<MF_Product.LightBusinessObjects.viewProductColor> OutdoorColorProperty = RegisterProperty<MF_Product.LightBusinessObjects.viewProductColor>(c => c.OutdoorColor);
    public MF_Product.LightBusinessObjects.viewProductColor OutdoorColor
    {
        get { return GetProperty(OutdoorColorProperty); }
        set { SetProperty(OutdoorColorProperty, value); }
    }

    public static readonly PropertyInfo<decimal?> OutdoorColorBaseUnitPriceProperty = RegisterProperty<decimal?>(c => c.OutdoorColorBaseUnitPrice);
    public decimal? OutdoorColorBaseUnitPrice
    {
        get { return GetProperty(OutdoorColorBaseUnitPriceProperty); }
        set { SetProperty(OutdoorColorBaseUnitPriceProperty, value); }
    }

    public static readonly PropertyInfo<MF_Product.LightBusinessObjects.viewProductColor> IndoorColorProperty = RegisterProperty<MF_Product.LightBusinessObjects.viewProductColor>(c => c.IndoorColor);
    public MF_Product.LightBusinessObjects.viewProductColor IndoorColor
    {
        get { return GetProperty(IndoorColorProperty); }
        set { SetProperty(IndoorColorProperty, value); }
    }

    public static readonly PropertyInfo<decimal?> IndoorColorBaseUnitPriceProperty = RegisterProperty<decimal?>(c => c.IndoorColorBaseUnitPrice);
    public decimal? IndoorColorBaseUnitPrice
    {
        get { return GetProperty(IndoorColorBaseUnitPriceProperty); }
        set { SetProperty(IndoorColorBaseUnitPriceProperty, value); }
    }

    public static readonly PropertyInfo<MF_Product.LightBusinessObjects.viewProductGlazing> GlazingProperty = RegisterProperty<MF_Product.LightBusinessObjects.viewProductGlazing>(c => c.Glazing);
    public MF_Product.LightBusinessObjects.viewProductGlazing Glazing
    {
        get { return GetProperty(GlazingProperty); }
        set { SetProperty(GlazingProperty, value); }
    }

    public static readonly PropertyInfo<decimal?> GlazingBaseUnitPriceProperty = RegisterProperty<decimal?>(c => c.GlazingBaseUnitPrice);
    public decimal? GlazingBaseUnitPrice
    {
        get { return GetProperty(GlazingBaseUnitPriceProperty); }
        set { SetProperty(GlazingBaseUnitPriceProperty, value); }
    }

    public static readonly PropertyInfo<MF_Product.LightBusinessObjects.viewProductGlass> GlassProperty = RegisterProperty<MF_Product.LightBusinessObjects.viewProductGlass>(c => c.Glass);
    public MF_Product.LightBusinessObjects.viewProductGlass Glass
    {
        get { return GetProperty(GlassProperty); }
        set { SetProperty(GlassProperty, value); }
    }

    public static readonly PropertyInfo<decimal?> GlassBaseUnitPriceProperty = RegisterProperty<decimal?>(c => c.GlassBaseUnitPrice);
    public decimal? GlassBaseUnitPrice
    {
        get { return GetProperty(GlassBaseUnitPriceProperty); }
        set { SetProperty(GlassBaseUnitPriceProperty, value); }
    }


    #endregion

    #region Localized Properties

    private long _CustomerID;
    public long CustomerID
    {
        get { return _CustomerID; }
        set { _CustomerID = value; }
    }

    #endregion

    #endregion

    #region Search Functions

    #endregion

    #region DataPortal Functions

    internal class DataPortal_FetchArgs
    {
        public string DefaultCollection { get; set; }
        public Models.MF_Product.Height Model { get; set; }
    }
    internal interface ISearchCriteria
    {
        string Collation { get; set; }
        Expression<Func<Models.MF_Product.Height, bool>> GetWhereExpression();
    }
    internal static Base.CORE.DataLayer.IDbContextBase DomainDrivenDesignBoundedContext
    {
        get { return new DataLayer.EnterpriseResourcePlanning.ProductContext(); }
    }

    protected override void DataPortal_Create()
    {
        CreateObject();
    }
    protected override void Child_Create()
    {
        base.Child_Create();
        CreateObject();
    }
    private void CreateObject()
    {

    }

    #endregion

    #region Validation

    protected override void AddBusinessRules()
    {

        base.AddBusinessRules();

        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(DoorProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_Door_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(OutdoorColorProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_OutdoorColor_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(IndoorColorProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_IndoorColor_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(GlazingProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_Glazing_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(GlassProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_Glass_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(DoorBaseUnitPriceProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_DoorBaseUnitPrice_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(DoorHeightDimensionProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_DoorHeightDimension_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(DoorWidthDimensionProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_DoorWidthDimension_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(OutdoorColorBaseUnitPriceProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_OutdoorColorBaseUnitPrice_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(IndoorColorBaseUnitPriceProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_IndoorColorBaseUnitPrice_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(GlazingBaseUnitPriceProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_GlazingBaseUnitPrice_RequiredRule; } });
        BusinessRules.AddRule(new Csla.Rules.CommonRules.Required(GlassBaseUnitPriceProperty) { Priority = 0, MessageDelegate = () => { return Resources.DoorBuilder_GlassBaseUnitPrice_RequiredRule; } });

        BusinessRules.AddRule(new LoadDimensions(DoorProperty, DoorHeightDimensionProperty, DoorWidthDimensionProperty) { Priority = -1 });
        BusinessRules.AddRule(new LoadDefaultOptions(DoorProperty, OutdoorColorProperty, IndoorColorProperty, DoorBaseUnitPriceProperty) { Priority = -1 });
        BusinessRules.AddRule(new LoadOutdoorColorBaseUnitPrice(OutdoorColorProperty, OutdoorColorBaseUnitPriceProperty) { Priority = -1 });
        BusinessRules.AddRule(new LoadIndoorColorBaseUnitPrice(IndoorColorProperty, IndoorColorBaseUnitPriceProperty) { Priority = -1 });
        BusinessRules.AddRule(new LoadDefaultGlazingOption(DoorProperty, GlazingProperty) { Priority = -1 });
        BusinessRules.AddRule(new LoadGlazingBaseUnitPrice(GlazingProperty, GlazingBaseUnitPriceProperty) { Priority = -1 });
        BusinessRules.AddRule(new LoadDefaultGlassOption(GlazingProperty, GlassProperty) { Priority = -1 });
        BusinessRules.AddRule(new LoadGlassBaseUnitPrice(GlassProperty, GlassBaseUnitPriceProperty) { Priority = -1 });
    }

    private class LoadDefaultOptions : Csla.Rules.BusinessRule
    {
        public IPropertyInfo OutdoorColor { get; set; }
        public IPropertyInfo IndoorColor { get; set; }
        public IPropertyInfo DoorBaseUnitPrice { get; set; }

        public LoadDefaultOptions(IPropertyInfo doorProperty, IPropertyInfo outdoorColorProperty, IPropertyInfo indoorColorProperty, IPropertyInfo doorBaseUnitPriceProperty)
            : base(doorProperty)
        {
            OutdoorColor = outdoorColorProperty;
            IndoorColor = indoorColorProperty;
            DoorBaseUnitPrice = doorBaseUnitPriceProperty;
            InputProperties = new List<IPropertyInfo> { doorProperty };
            AffectedProperties.Add(OutdoorColor);
            AffectedProperties.Add(IndoorColor);
            AffectedProperties.Add(DoorBaseUnitPrice);
        }

        protected override void Execute(RuleContext context)
        {
            var customerID = ((DoorDetail)context.Target).CustomerID;
            var collation = ((DoorDetail)context.Target).DefaultCollation;
            var door = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductDoor)context.InputPropertyValues[PrimaryProperty]);
            var outdoorColor = door != null ? BusinessObjects.MF_Product.LightBusinessObjects.viewProductColor.GetDefaultOutdoorColor(door.ID, customerID, collation) : null;
            var indoorColor = door != null ? BusinessObjects.MF_Product.LightBusinessObjects.viewProductColor.GetDefaultIndoorColor(door.ID, customerID, collation) : null;

            context.AddOutValue(OutdoorColor, outdoorColor);
            context.AddOutValue(IndoorColor, indoorColor);
            context.AddOutValue(DoorBaseUnitPrice, door != null ? door.BaseUnitPrice : null);
        }
    }

    private class LoadDefaultGlazingOption : Csla.Rules.BusinessRule
    {
        public IPropertyInfo Glazing { get; set; }

        public LoadDefaultGlazingOption(IPropertyInfo doorProperty, IPropertyInfo glazingProperty)
            : base(doorProperty)
        {
            Glazing = glazingProperty;
            InputProperties = new List<IPropertyInfo> { doorProperty };
            AffectedProperties.Add(Glazing);
        }

        protected override void Execute(RuleContext context)
        {
            var customerID = ((DoorDetail)context.Target).CustomerID;
            var collation = ((DoorDetail)context.Target).DefaultCollation;
            var door = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductDoor)context.InputPropertyValues[PrimaryProperty]);
            var glazing = door != null ? BusinessObjects.MF_Product.LightBusinessObjects.viewProductGlazing.GetDefaultGlazing(door.ID, customerID, collation) : null;
            context.AddOutValue(Glazing, glazing);
        }
    }

    private class LoadDefaultGlassOption : Csla.Rules.BusinessRule
    {
        public IPropertyInfo Glass { get; set; }

        public LoadDefaultGlassOption(IPropertyInfo glazingProperty, IPropertyInfo glassProperty)
            : base(glazingProperty)
        {
            Glass = glassProperty;
            InputProperties = new List<IPropertyInfo> { glazingProperty };
            AffectedProperties.Add(Glass);
        }

        protected override void Execute(RuleContext context)
        {
            var customerID = ((DoorDetail)context.Target).CustomerID;
            var collation = ((DoorDetail)context.Target).DefaultCollation;
            var doorID = ((DoorDetail)context.Target).Door.ID;
            var glazing = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductGlazing)context.InputPropertyValues[PrimaryProperty]);
            var glass = glazing != null ? BusinessObjects.MF_Product.LightBusinessObjects.viewProductGlass.GetDefaultGlass(doorID, customerID, glazing.ProductID, collation) : null;
            context.AddOutValue(Glass, glass);
        }
    }

    private class LoadDimensions : Csla.Rules.BusinessRule
    {
        public IPropertyInfo HeightDimension { get; set; }
        public IPropertyInfo WidthDimension { get; set; }


        public LoadDimensions(IPropertyInfo doorProperty, IPropertyInfo heightDimensionProperty, IPropertyInfo widthDimensionProperty)
            : base(doorProperty)
        {

            HeightDimension = heightDimensionProperty;
            WidthDimension = widthDimensionProperty;
            InputProperties = new List<IPropertyInfo> { doorProperty };
            AffectedProperties.Add(HeightDimension);
            AffectedProperties.Add(WidthDimension);
        }

        protected override void Execute(RuleContext context)
        {
            var door = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductDoor)context.InputPropertyValues[PrimaryProperty]);
            context.AddOutValue(HeightDimension, door != null ? door.HeightDimension : null);
            context.AddOutValue(WidthDimension, door != null ? door.WidthDimension : null);
        }
    }

    private class LoadOutdoorColorBaseUnitPrice : Csla.Rules.BusinessRule
    {
        public IPropertyInfo OutdoorColorBaseUnitPrice { get; set; }

        public LoadOutdoorColorBaseUnitPrice(IPropertyInfo outdoorColorProperty, IPropertyInfo outdoorColorBaseUnitPriceProperty)
            : base(outdoorColorProperty)
        {

            OutdoorColorBaseUnitPrice = outdoorColorBaseUnitPriceProperty;
            InputProperties = new List<IPropertyInfo> { outdoorColorProperty };
            AffectedProperties.Add(OutdoorColorBaseUnitPrice);
        }

        protected override void Execute(RuleContext context)
        {
            var customerID = ((DoorDetail)context.Target).CustomerID;
            var collation = ((DoorDetail)context.Target).DefaultCollation;
            var outdoorColor = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductColor)context.InputPropertyValues[PrimaryProperty]);

            context.AddOutValue(OutdoorColorBaseUnitPrice, outdoorColor != null ? outdoorColor.BaseUnitPrice : null);
        }
    }

    private class LoadIndoorColorBaseUnitPrice : Csla.Rules.BusinessRule
    {
        public IPropertyInfo IndoorColorBaseUnitPrice { get; set; }

        public LoadIndoorColorBaseUnitPrice(IPropertyInfo IndoorColorProperty, IPropertyInfo IndoorColorBaseUnitPriceProperty)
            : base(IndoorColorProperty)
        {

            IndoorColorBaseUnitPrice = IndoorColorBaseUnitPriceProperty;
            InputProperties = new List<IPropertyInfo> { IndoorColorProperty };
            AffectedProperties.Add(IndoorColorBaseUnitPrice);
        }

        protected override void Execute(RuleContext context)
        {
            var customerID = ((DoorDetail)context.Target).CustomerID;
            var collation = ((DoorDetail)context.Target).DefaultCollation;
            var indoorColor = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductColor)context.InputPropertyValues[PrimaryProperty]);

            context.AddOutValue(IndoorColorBaseUnitPrice, indoorColor != null ? indoorColor.BaseUnitPrice : null);
        }
    }

    private class LoadGlazingBaseUnitPrice : Csla.Rules.BusinessRule
    {
        public IPropertyInfo GlazingBaseUnitPrice { get; set; }

        public LoadGlazingBaseUnitPrice(IPropertyInfo glazingProperty, IPropertyInfo glazingBaseUnitPriceProperty)
            : base(glazingProperty)
        {

            GlazingBaseUnitPrice = glazingBaseUnitPriceProperty;
            InputProperties = new List<IPropertyInfo> { glazingProperty };
            AffectedProperties.Add(GlazingBaseUnitPrice);
        }

        protected override void Execute(RuleContext context)
        {
            var customerID = ((DoorDetail)context.Target).CustomerID;
            var collation = ((DoorDetail)context.Target).DefaultCollation;
            var glazing = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductGlazing)context.InputPropertyValues[PrimaryProperty]);

            context.AddOutValue(GlazingBaseUnitPrice, glazing != null ? glazing.BaseUnitPrice : null);
        }
    }

    private class LoadGlassBaseUnitPrice : Csla.Rules.BusinessRule
    {
        public IPropertyInfo GlassBaseUnitPrice { get; set; }

        public LoadGlassBaseUnitPrice(IPropertyInfo glassProperty, IPropertyInfo glassBaseUnitPriceProperty)
            : base(glassProperty)
        {

            GlassBaseUnitPrice = glassBaseUnitPriceProperty;
            InputProperties = new List<IPropertyInfo> { glassProperty };
            AffectedProperties.Add(GlassBaseUnitPrice);
        }

        protected override void Execute(RuleContext context)
        {
            var customerID = ((DoorDetail)context.Target).CustomerID;
            var collation = ((DoorDetail)context.Target).DefaultCollation;
            var glass = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductGlass)context.InputPropertyValues[PrimaryProperty]);
            context.AddOutValue(GlassBaseUnitPrice, glass != null ? glass.BaseUnitPrice : null);
        }
    }

    #endregion
}

}

Thanks a lot.

Manage whether lazy child objects are sent to the server

I have a couple of questions about lazy child objects and how they are handled regarding sending to the server:

  1. If the client has a Parent object and triggers the loading of the Lazy Child, and the Parent is then updated, but the Lazy Child is not, when the Parent is saved does the Lazy Child get sent back to the server? Is there a mechanism for avoiding sending this child back to the server?
  2. If the client has a Parent object and triggers the loading of the Lazy Child, and the Parent is then explicitly sent to the server (perhaps a copy operation for another business object takes the Parent as the input parameters for a Create operation), is the a mechanism or preferred method for ensuring the child is not sent to the server (if not required).

I don't really want to over-optimise if I can avoid it, but I want to be sure what my options are before I go ahead.

Best Way to Enforce One Date Property is Less Than Another?

I have two properties in my business object called DateEmployedFrom and DateEmployedTo and want to know the easiest way to create a rule that enforces the from date is less than the to date?

Currently the app is using attributes to enforce rules but I don't think there is a way to do it with attributes, unless there is?

Thanks
Mark

CSLA 4.6.1 breaking changes?

That class and others similar to this one (which was adapted from the MyVote Las Vegas 2013 project for Microsoft.Unity)
does not work anymore, it asks me to implement System.IClonable.Clone()
As something changed related to that?

namespace Dealerlive.CSLA.Core
{
using System;

using Csla;

using Dealerlive.Core;
using Dealerlive.CSLA.Core.Contracts;

if !NETFX_CORE && !WINDOWS_PHONE

[System.Serializable]

else

[Csla.Serialization.Serializable]

endif

public abstract class ReadOnlyBaseCore<T> : ReadOnlyBase<T>, IReadOnlyBaseCore where T : ReadOnlyBaseCore<T> 
{
    protected ReadOnlyBaseCore()
        : base() { }

if !NETFX_CORE && !WINDOWS_PHONE

    protected override void Child_OnDataPortalInvoke(DataPortalEventArgs e) {
        base.Child_OnDataPortalInvoke(e);
                  IoC.BuildUpProperties(this);
    }

    protected override void Child_OnDataPortalException(DataPortalEventArgs e, Exception ex) {
        base.Child_OnDataPortalException(e, ex);
        //this._scope.Dispose();
    }

    protected override void Child_OnDataPortalInvokeComplete(DataPortalEventArgs e) {
        base.Child_OnDataPortalInvokeComplete(e);
        //this._scope.Dispose();
    }

    protected override void DataPortal_OnDataPortalInvoke(DataPortalEventArgs e) {
        base.DataPortal_OnDataPortalInvoke(e);
        IoC.BuildUpProperties(this);
    }

    protected override void DataPortal_OnDataPortalException(DataPortalEventArgs e, Exception ex) {
        base.DataPortal_OnDataPortalException(e, ex);

    }

    protected override void DataPortal_OnDataPortalInvokeComplete(DataPortalEventArgs e) {
        base.DataPortal_OnDataPortalInvokeComplete(e);

    }

endif

}

}

Thanks,

Business Rule + Validation Rule

I have an async business rule that gets data from a table and sets other properties of the object, after these are set I want to validate that the required properties are set.

Here is what I did something like this

public class AsyncBusinessRule : BusinessRule
{
private Csla.Rules.IBusinessRule InnerRule1 { get; set; }

        public AsyncBusinessRule(IPropertyInfo primaryProperty, IPropertyInfo secondProperty, IPropertyInfo thirdProperty, IPropertyInfo forthProperty, IPropertyInfo fifthProperty, IPropertyInfo sixthProperty, IBusinessRule innerRule1)
            : base(primaryProperty)
        {
            this.InputProperties = new List<IPropertyInfo> { primaryProperty, secondProperty, thirdProperty, forthProperty, fifthProperty, sixthProperty };

            this.AffectedProperties.Add(primaryProperty);
            this.AffectedProperties.Add(secondProperty);
            this.AffectedProperties.Add(thirdProperty);
            this.AffectedProperties.Add(forthProperty);
            this.AffectedProperties.Add(fifthProperty);

            InnerRule1 = innerRule1;

            IsAsync = true;

            this.ProvideTargetWhenAsync = true;
        }

        protected async override void Execute(RuleContext context)
        {
            var purchaseInvoiceIDProperty = this.AffectedProperties[1];
            var purchaseInvoiceID = (string)context.InputPropertyValues[purchaseInvoiceIDProperty];

            var invoiceIDProperty = this.AffectedProperties[2];
            var invoiceID = (string)context.InputPropertyValues[invoiceIDProperty];

            var supplierUIDProperty = this.AffectedProperties[3];
            var supplierUID = (Guid?)context.InputPropertyValues[supplierUIDProperty];

            var invoiceDateProperty = this.AffectedProperties[4];
            var invoiceDate = (DateTime)context.InputPropertyValues[invoiceDateProperty];

            var purchaseInvoiceUIDProperty = this.AffectedProperties[5];

            var isAInOutProperty = this.InputProperties[5];
            var isAInOut = (byte)context.InputPropertyValues[isAInOutProperty];

            IPurchaseInvoiceInfoList purchaseInvoiceInfoList = null;

            try
            {
                if (!string.IsNullOrWhiteSpace(purchaseInvoiceID) || !string.IsNullOrWhiteSpace(invoiceID) || (supplierUID != null && supplierUID != Guid.Empty))
                {
                    purchaseInvoiceInfoList = await purchaseInvoiceInfoListFactory.FetchAsync(new PurchaseInvoiceCriteria() { PurchaseInvoiceID = purchaseInvoiceID, InvoiceID = invoiceID, SupplierUID = (Guid)supplierUID });

                    if (purchaseInvoiceInfoList != null && purchaseInvoiceInfoList.Any())
                    {
                        if (purchaseInvoiceInfoList.First().StatusFlag <= Constants.StatusFlagClosed)
                        {
                            context.AddOutValue(purchaseInvoiceUIDProperty, purchaseInvoiceInfoList.First().PurchaseInvoiceUID);
                            context.AddOutValue(purchaseInvoiceIDProperty, purchaseInvoiceInfoList.First().PurchaseInvoiceID);
                            context.AddOutValue(invoiceIDProperty, purchaseInvoiceInfoList.First().InvoiceID);
                            context.AddOutValue(supplierUIDProperty, purchaseInvoiceInfoList.First().SupplierUID);
                            context.AddOutValue(invoiceDateProperty, purchaseInvoiceInfoList.First().InvoiceDate);

                            var chainedContext = context.GetChainedContext(this.InnerRule1);
                            this.InnerRule1.Execute(chainedContext);
                         }
                        else
                        {
                            context.AddErrorResult(ErrorConstants.ERROR_THIS_PURCHASE_INVOICE_IS_CLOSED);
                        }
                    }
                }

            }
            catch (Exception e)
            {
                Debug.WriteLine("Business rule AsyncBusinessRule Error {0} ", e);
            }
            finally
            {
                context.Complete();
            }
        }
    }

The problem seems to be that this code
var chainedContext = context.GetChainedContext(this.InnerRule1);
this.InnerRule1.Execute(chainedContext);

The inner rule contains the original value and not the affected one, if I put
context.Complete();
before I call the GetChaingedContext.

What Am I doing wrong?

ViewModelBase.cs - on ANDROID and IOS Model and ManageObjectLifetime setters should raise OnPropertyChanged

Source from 4.5.x branch, on ViewModelBase.cs

There are two DP properties:

  • Model / ModelProperty
  • ManageObjectLifetime / ManageObjectLifetimeProperty

When converting DP to regular properties, their setter shoud raise OnPropertyChanged.

Rocky,

As i said on a previous post, although I have a signed a contribution agreement, I don't think I should commit these changes since I have no way to test them (I not running Xamarin).

Move cslacontrib to github?

@jonnybee I wonder if we should move cslacontrib from codeplex to GitHub?

If we move it to GitHub it would be listed along with CSLA itself, and so I think it would be easier to find.

Thoughts?

WcfPortal, Client criteria reset at Serverside and List returned initialized on Clientside with empty childs.

Hi All, i thing i am missing some configuration step, here are step to pull data:

Step1:
In WinRT App setup,
Using Csla 4.5.7 with Windows 8.1 Store App , App.xaml.cs OnLaunched event has
Csla.ApplicationContext.DataPortalProxy = typeof(Csla.DataPortalClient.WcfProxy).AssemblyQualifiedName;
Csla.ApplicationContext.DataPortalUrlString = "http://localhost/WcfAppServer/MobilePortal.svc";

Step2:
Xaml page call GetItemsInfoListAsync(1, 5)

Step3:
Bussines.Lib.WinRT passes pageIdx=1 and pgSize=5 to FilterCriteria object and calls DataPortal as
await DataPortal.FetchAsync(new FilterCriteria("ALL", pageIdx, pageSize, ItemImage.ItemImageCategory.Thumbnail));

Step4:
When call receives at DataPortal_Fetch(FilterCriteria criteria), the criteria object does not have (pgIdx=1,pgSize=5), instead it is initialized to default values (pgIdx=1,pgSize=20), and instantiate the List with 20 childen in it and return the result back.

Step5:
On WinRT side received a list of 20 items, but all those child are initialized to default/empty properties, even though the list returned by WcfPortal was with actual 20 items initialised with db-values. Somewhere data got lost and a list got initialized with some default empty items in it.

So my issue are, when i passed (pgIdx=1,pgSize=5) in criteria, this criteria does not reached to server side, instead a default criteria object with (pgIdx=1, pgSize=20) passed down to server side DataPortal_Fetch method. Even though the List with 20 items returned back from server side =, when it reached on client side, a list of 20 items received, but all those 20 items initialized with default/empty properties. I don't know what am i missing in configuration?

Asad.

Generic interface in DAL layer for all BO.

Has somebody tried to use a generic interface in DAL layer for all BO?

/// <summary>
/// Interface to be implemented by any business object.
/// </summary>
/// <typeparam name="D">Dto object</typeparam>
/// <typeparam name="I">Info dto object</typeparam>
/// <typeparam name="C">List criteria</typeparam>
public interface IBusinessObjectDal<D, I, C>
{
    List<I> FetchList(C criteria);
    D Fetch(Guid id);
    void Insert(D dto);
    void Update(D dto);
    void Delete(Guid id);
}

CslaGenFork 4.5.3 (stable) was release

Targets:

  • CSLA 4.3 (NET 4.0, Silverlight 4 and Silverlight 5)
  • CSLA 4.5 (NET 4.0, NET 4.5 and Silverlight 5)

Fixes and improvements:

  • Create child collections gesture failed to add properties to item object.
  • Assign properties from DB: non nullable properties don't need to check IsDBNull.
  • Updated Value Properties: id properties shouldn't be updated.
  • Updated Value Properties: EditableChild can be update source.
  • Add link to new forum on the start page.

Full release notes and download
http://cslagenfork.codeplex.com/releases/view/615981

C#/XAML for HTML5

Hi,

Continued from the old forum:
http://forums.lhotka.net/forums/t/12900.aspx

I asked this question in the CSHTML5 forum:

Any plans on implementing these?:
IEditableObject, INotifyDataErrorInfo, INotifyPropertyChanging
, System.ComponentModel.BackgroundWorker, DoWorkEventHandler,
RunWorkerCompletedEventHandler, ProgressChangedEventHandler
, System.Runtime.Serialization.DataContractSerializer
, LinkedList

http://forums.cshtml5.com/viewtopic.php?f=4&t=122

And got this answer:

  • Validation: yes, this is on the roadmap for mid-2016. It will natively support INotifyDataErrorInfo,
    INotifyPropertyChanging, and probably also IEditableObject.
  • Background work: this is not possible because of the limitations of JavaScript running in the browser. >It is not possible in JavaScript to create background threads that share objects with the UI thread. >Therefore unfortunately the following classes cannot be supported: BackgroundWorker, >DoWorkEventHandler, RunWorkerCompletedEventHandler, ProgressChangedEventHandler.
  • DataContractSerializer: at the moment CSHTML5 only supports the XmlSerializer. We plan to
    support the DataContractSerializer as well, by the end of 2016.
  • LinkedList: yes, this is on the roadmap for 2016 as well.

To ensure faster implementation of those features, please vote for them on UserVoice at: http://cshtml5.uservoice.com/

So, vote for Validation ๐Ÿ˜ƒ
http://cshtml5.uservoice.com/forums/274799-c-xaml-for-html5-feature-requests/suggestions/9204063-add-support-for-system-componentmodel-dataannotati

BackgroundWorker will not be supported. Can that be solved?

Is it true that DataContractSerializer is not needed because MobileFormatter can be used?

Wilfred

Pass parameter to Business Object to use in BusinessRules.

Hi. I have a Business object "DoorDetail" that has as Property "Glazing" and another property "Glass". When this GLazing property change, A rules that load the Default Glass property is executed. This rule Fetch the default Glass by GlazingID, but also needs a CustomerID and a DoorID that I have in the viewModel to Fetch the Default Glass. This viewModel is the same that has the instance of the DoorDetail. What's the best practice to solve this problem? Do I have to add a property CustomerID and DoorID to the BusinessObject and passe it from the ViewModel?? It looks weird.

Here's the code of the Rules.

private class LoadDefaultGlassOption : Csla.Rules.BusinessRule
{
public IPropertyInfo Glass { get; set; }

            public LoadDefaultGlassOption(IPropertyInfo glazingProperty, IPropertyInfo glassProperty)
                : base(glazingProperty)
            {
                Glass = glassProperty;
                InputProperties = new List<IPropertyInfo> { glazingProperty };
                AffectedProperties.Add(Glass);
            }

            protected override void Execute(RuleContext context)
            {
                var customerID = ?
                var door = ?
                var glazing = ((BusinessObjects.MF_Product.LightBusinessObjects.viewProductGlazing)context.InputPropertyValues[PrimaryProperty]);
                var glass = glazing != null && door != null ? BusinessObjects.MF_Product.LightBusinessObjects.viewProductGlass.GetDefaultGlass(door.ID, customerID, glazing.ProductID) : null;

                context.AddOutValue(Glass, glass);
            }
        }

Thanks a lot!!

Rare issue involving remote portal is duplicating records at database

Hello

Is it possible that a DataPortal_Insert() sub is being executed erroneusly two times when running under a remote portal?

I mean some rare/weird race conditions (possibly involving threads and IIS), maybe where the IIS server thread is killed then recreated, or something like that.

I have found duplicated records in the DB, these records have exactly the same data (even complete dates with milliseconds) except for the Primary Key wich are normally consecutive ids (99%) or very close (1%).

I suspect that DP_Insert is executing twice when using a remote portal in very rare occasions. I have a variety of applications running Csla43 and I've experienced this issue always with a remote portal (both WCF and Remoting, hosted in IIS7) and never with local portal.

Any clues would be appreciated, Thank you!

ViewModelBase.cs - on ANDROID and IOS ManageObjectLifetimeProperty should default to true

Source from 4.5.x branch, on ViewModelBase.cs we can read

if ANDROID || IOS

public bool ManageObjectLifetimeProperty;

else

public static readonly DependencyProperty ManageObjectLifetimeProperty =
    DependencyProperty.Register("ManageObjectLifetime", typeof(bool),
    typeof(ViewModelBase<T>), new PropertyMetadata(true));

endif

On ANDROID and IOS shouldn't ManageObjectLifetimeProperty default value be "true"?

if ANDROID || IOS

public bool ManageObjectLifetimeProperty = true;

else

....

Rocky,

Although I have a signed a contribution agreement, I don't think I should commit these changes since I have no way to test them (I not running Xamarin). BTW I'm porting this class to WindowsForms and found interesting to see what was done on another non DP platform.

DataFieldManager throws and Exception when attempting to render a "Microsoft.Reporting.WinForms.LocalReport"

While having a custom IIdentity that is implemented using a Csla.ReadOnlyBase set in Csla.ApplicationContext.User, then attempting to render a LocalReport using the Local reporting services engine, we get the following exception.

{"Failed to load expression host assembly. Details: Attempt by method 'Csla.Core.FieldManager.FieldDataManager.ForceStaticFieldInit(System.Type)' to access field 'Csla.ReadOnlyBase`1<SSRSClientCSLAIdentityBug.TestIdentity>.CS$<>9__CachedAnonymousMethodDelegate5' failed."}

The problem happens during the LocalReport.Render() call - it looks like the FieldDataManager is attempting to read an anonymous delegate using reflection. (I stepped into the CSLA code to the exact place where it occurs (FieldDataManager.cs Line 967).

I should also mention that this issue does not happen in version 4.6.* beta.

Dataportal.Fetch Failed. (After Refresh all ok)

Hello.

For or project we are using csla 4.3.14.

I'm getting various errors. but when i refresh the page a coupple of times all the errors are gone and the page loads succesfully.

On of the errors are:

DataPortal.Fetch failed (Property load or set failed for property TextValue (Collection was modified; enumeration operation may not execute.))
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ServiceModel.FaultException: DataPortal.Fetch failed (Property load or set failed for property TextValue (Collection was modified; enumeration operation may not execute.))

Source Error:

Line 17:
Line 18:
Line 19: @Html.Partial("MenuBar", new MenuBarModel())
Line 20:

Anyone have any idea?

CSLA 4.2 version running on Microsoft .Net 4.5.2 Framework

Has anyone seen any issues running the CSLA 4.2 version with a 2010 VB .net application on the .Net 4.5.2 Framework?

We currently run our application with CSLA 4.2 on the 4.0 .net Framework.
Microsoft is indicating that this is clean upgrade and should not affect applications compiled on the 4.0 framework.

We are not looking to update CSLA Version at this time, just hoping to upgrade the .net framework and continue to run the application as normal.

Looking to head off potential issues with this upgrade if anyone else has experienced this type of upgrade has run into any problems.

Thanks

Csla.PropertyLoadException

Working in WPF, I am getting a baffling error that I never saw in SL.
I have a large object tree. The root object reads all the data from the database, and then calls a method (SetParentAndModel), on each child. Child simply set the Model value to the object it receives. This process goes down through the entire tree. Has worked like a charm in SL for > 2 years.

6 weeks ago, while converting to WPF, I ran into an error while the object tree was loading.
Error : Items collection must be empty before using ItemsSource.
One or two of the objects have child collections, and it turned out that those collections were causing the error. After struggling with it for days, I dismantled much of the code, and while playing with it, just like that - for some reason, the error disappeared. To this day, I have no idea why. So much so that I have basically put everything almost (but not completely) back to how it was and everything has worked fine.

Today, decided to include one last object that also has a single collection, and started getting the same error. Finally I decided to populate the object field by field from the object received from the parent. Everything went smoothly until I got to the child collection, and no matter what I did, I could not get rid of the error. After trying everything, I decided to separately create instance of the collection and then set the collection in the object to this new instance. That is when I got the error Csla.PropertyLoadException.

It just so happened that while typing this message, and going back and meddling with the code, one time when I ran the application, the error simply did not come up. At first I thought I might have commented out some lines, but no. I have put everything back, except that I instantiate the object and set each of its fields separately from the object sent by the parent (I was doing exactly that for about an hour and the error was still there). But now no error. I have no idea why the error has stopped. I have checked under the table, behind the cabinet - I see no ghosts, no goblins, nothing.

Since I had started typing this message, I thought I might as well finish. Perhaps more experienced people may have an explanation.

Javed

HttpProxy only supports XYZAsync calls?

This is the same question from this forum post: http://forums.lhotka.net/forums/p/12856/58146.aspx

In investigating how to configure the HttpProxy, it looks like you can only use DataPortal.XYZAsync calls; the normal sync calls fail due to a condition enforced by the proxy.

What is the reason for this? We were hoping to move to this to support WP8.1 and other mobile platforms, but also for our WinForms client as well. The way it looks right now is that we'd either have to change all our factory methods to return Task and become async which also means code changes in our forms, or having to use WCF for the WinForms app and HttpProxy for everything else. Is there something else I'm missing?

LoadProperty vs. BypassPropertyChecks

Hello !
What is for performance better in a Fetch / Load Routine ?
Load each Property with LoadProperty(.....)
or Set using (BypassPropertyChecks) and load each Property with this.MyProperty = ... ?
Also for a Write Routine
Use ReadProperty or Get Every Property by using (BypassPropertyChecks) ?
Thank you for an answer!
Thilo

New forum location

I am giving serious consideration to this being the new forum location for CSLA .NET.

Try it out and let me know what you think.

.Net 4.62

Will there be any issues with .Net 4.62 when it's released?

Sample besides Projecttracker which uses Asp.Net Mvc and csla .4.5

Hi everyone,

I have developed and successfully deployed several apps for CSLA 3.8 and winforms.

Now, I have started csla 4.5 but it is very confusing.

Q: Is it necessary to use Async operations for MVC?
Q: Is a sample app available for new users which shows a Order--->LineItems--->LineItem type app which uses all the new features of CSLA 4.5.

regards

pat cash

Aah! There y'all are!

Took some work, but finally found this place. No questions - just wanted to get re-acquainted. They had me change my old name (jav) to javed007. Well they didn't make me choose 007, that was my idea.

Odd XML Comment Issue

I was looking at the Intellisense for Save(), and I noticed the docs didn't read very well. Here's a screen shot:

csla xml comments

It seems like the <see langword stuff is being ignored:

/// If <see langword="true"/>, triggers overriding IsNew and IsDirty. 
/// If <see langword="false"/> then it is the same as calling Save().

This is in VS 2015. This may be something that CSLA is doing right and VS has a bug in it, but I thought I'd report it here first.

Move Serializable attribute to System namespace

Please provide your feedback on this idea

I am considering a change that I think shouldn't break anyone, but which would clean up the way people implement x-plat classes in CSLA.

MarimerLLC/csla#407

Basically today to create an x-plat class you need this:

using System;
using Csla.Serialization;

[Serializable]
public class Foo : BusinessBase<Foo>

With the proposed change you would not need the using Csla.Serialization statement:

using System;

[Serializable]
public class Foo : BusinessBase<Foo>

Obviously that's a source of bugs and is just one less thing to deal with. Perhaps more importantly, in VS15 with shared projects and the way the code editor greys out using statements it often looks like using Csla.Serialization isn't required, when in reality it is required - just on some other platform.

Posting Multiple Lists to an MVC5 Controller

I have use case to display and edit three editable collections on a single MVC view.
(Simplified Examples Below)

public ActionResult EditRoleClaim(int id)
{
var roleClaims = RoleClaimManager.GetRoleClaims(id);
ViewData["Objects"] = roleClaims.BusinessObjectList;
ViewData["Methods"] = roleClaims.BusinessMethodList;
ViewData["Properties"] = roleClaims.BusinessPropertyList;
return View();
}

The lists are parsed into tables within a tabbed container and all is fine at this point.

    @{var objectList = (RoleClaimObjectEditList)ViewData["Objects"];}
    @for (int i = 0; i < objectList.Count; i++)
    {
        @Html.HiddenFor(modelItem => objectList[i].Id)
        @Html.HiddenFor(modelItem => objectList[i].RowVersion)
        @Html.CheckBoxFor(modelItem => objectList[i].CanGet)
        @Html.CheckBoxFor(modelItem => objectList[i].CanCreate)
        @Html.CheckBoxFor(modelItem => objectList[i].CanEdit)
        @Html.CheckBoxFor(modelItem => objectList[i].CanDelete)
    }

The question is, how do I to post this back to the controller and update the lists or is it even possible?

[HttpPost]
public ActionResult EditRoleClaim(int id, FormCollection roleClaims)
{
// At this point I can see all of the lists and there new values in roleClaims.
// But I know I can't just call UpdateModel like the example below.

    var objectList = RoleClaimObjectEditList.GetList(id);
    UpdateModel(objectList, roleClaims);
    SaveObject(objectList, false);

...
...

Custom Model Binder?

Conventions for this "forum?"

Just starting to use this new forum; in the previous we had a Verify Answer button. Should we close issues that we feel are resolved here? I ask because the default when clicking on the Issues link is to only show open issues, so closed ones might be missed.

Windows Store App CSLA CanWriteProperty and null value properties

In my windows store app, i have properties (6 of them in the sample app) in an object that I want read-only after a certain status flag is set to a particular value.

I would seem that when the properties value is null the canwriteproperty method is not fired or triggered? In my sample app, there are 6 properties, 3 of them with data and 3 of them null, all of them should be disabled in the UI because of the canwriteproperty method, but only those not null are disabled.

Am I missing something?

I have a sample app located here
https://onedrive.live.com/redir?resid=F07DB383718C20E5%21224178

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.