CSLA .NET Contrib News Feed 
Friday, January 30, 2015  |  From CSLA .NET Contrib

(new to CSLA) - I am trying to do some collection validation, but it does not scale.  I would like to write my own method that will loop through the collection without firing any additional events and if I find an object is invalid, I would like to manually set the property to be invalid, which would be reflected through the interface. 

Thursday, January 29, 2015  |  From CSLA .NET Contrib

Hi,


When I try to use DataPortal.ProxyModes as the second parameter in my DataPortal.BeginCreate() method I get the error "Unknown member 'ProxyModes' of 'Csla.DataPortal'"


Has ProxyModes been removed from Csla.DataPortal? I use version 4.5.601 of Csla.


Thanks,


Peter Centellini 

Monday, January 26, 2015  |  From CSLA .NET Contrib

Hi guys, we are using Csla for our business objects, currently using version 3.8.4. There was a requirement to get property value into one of Child's Child object. I was trying to use IParent interface to climb up in hierarchy. But it seems to me i am doing some thing wrong or may be i missed something. Please find attached console test application. i commented out the access path in objB.CheckBsParent() method.


A quick response will be appreciated.


 


Regards.

Thursday, January 22, 2015  |  From CSLA .NET Contrib

Hi,


I have read on many posts about the error message that it is there because we try to write to a collection when it is in ReadOnly mode.


In my case I am setting a property and after that using PropertyHasChanged(string item) method


where the error comes.


The class in which we have used the validation is inheritted from BusinessBAse.


I would like to know where is the best place to set ReadOnlyP propert to False and 


which method shoul I implement and if you can let me know how.


I would appreciate,


Thanks in advance.

Thursday, January 22, 2015  |  From CSLA .NET Contrib

Been using 2.0 framework for quite a few years (obviously).  I am trying to move to to version 3.05 but I am unable to compile due to error.  No modifications have been made to the code.  The error preventing compilation is:


Class: ObjectAdapter


Sub: Fill


Line: 25 className = TypeName (source)


Error: System.RunTime.Serialization.TypeName is not accessible in this context because it is Private.


Anyone have any idea why this is happening?


Appreciate anyone's help.


Jim

Sunday, January 18, 2015  |  From CSLA .NET Contrib

Hi all,


I wonder whether one must really use BindingSource under Windows Forms. Did anyone try doing it without BindingSource?

Saturday, January 17, 2015  |  From CSLA .NET Contrib

Does any one has sample or a resource link how to integrate WPF DataGrid with CSLA MVVM but using Caliburn Micro ?


-The model from Viewmodel is to be assigned to a Model Collectiion View Source on the event Model_Changed


-The Grid will bind to Model Collection View Source


-I looked at http://forums.lhotka.net/forums/p/9985/46825.aspx#46825, they are binding it to a observable collection, but I found issues binding grid to a collection view source for the model of the view model


-Are there any conventions with Data Grid binding with caliburn ? The link did not mention datasource/itemsouce on the data grid but the name of the grid matched observable collection . I wanted to know all such conventions.


Kindly suggest  


 

Thursday, January 15, 2015  |  From CSLA .NET Contrib

I know that this capability has been added to CSLA 4.x with the inclusion of the IDataPortalExceptionInspector.  We have an old "legacy" project using CSLA 3.0.x (but which I just verified today could be upgraded to 3.8 in a couple of hours if need be).


We would like to add server-side data portal exception logging (since the server is in our dmz which has access to our database where we can log it. )


Can this be done in 3.8x?  I was hoping that it would raise some kind of exception event that we could subscribe too but I don't see anything.


It is NOT a have-to-do item but would be nice.  Any ideas?


Seth


 

Thursday, January 15, 2015  |  From CSLA .NET Contrib

Version 4.5.680-Beta is now available via NuGet.


A list of changes is here:


https://github.com/MarimerLLC/csla/issues?q=is%3Aissue+milestone%3A4.5.700+is%3Aclosed


This release adds support for the new Xamarin universal runtime and project types. It also includes some other bug fixes and minor enhancements.

Wednesday, January 14, 2015  |  From CSLA .NET Contrib

I'm hoping someone can correct my ignorance here.


I have upgraded my solution from EF5 to EF6.


I am using ObjectContextManager in my data layer, database-first with an edmx model.


To upgrade to EF6 I followed the guide on MSDN: http://msdn.microsoft.com/en-us/data/upgradeef6.aspx


So now, in my model,


public partial class StoreDataContext : ObjectContext


"ObjectContext" refers to System.Data.Entity.Core.Objects.ObjectContext. Good so far.


However, in my Dal I now have errors everywhere:


using (var ctx = ObjectContextManager<StoreDataContext>.GetManager("StoreDataContext"))


There error is: The type 'Store.DataAccess.Ef.StoreDataContext' must be convertible to type 'System.Data.Objects.ObjectContext' in order to use it as parameter 'C' in the generic class 'Csla.Data.ObjectContextmanager<C>'


Hmm. I tried referencing the Csla.Data.EF6 library, assuming there was something in it that I could use, but it only contains DbContextManager. I need ObjectContextManager - changing to DbContextManager would require massive changes in all my Dal code.


Can someone help?


 

Sunday, January 11, 2015  |  From CSLA .NET Contrib

Hello everybody,


I started to use the ProjectEdit functionality exposed by Rocky in WEB ProjectTracker project. But DetailsView control give me an ugly issue: Insert and Update are working fine only for the first press of these buttons.  My object has errors so, when I press insert button first time, all error are displayed properly in label error. If I will press insert button again, details view become invisible.


Bellow is the list of events when I press insert button first time:


1. DetailsView1_ItemCreated. It allows to fill values of controls from DetailsView:



If DetailsView1.DefaultMode = DetailsViewMode.Insert Then


   Dim obj As RootObject = GetObject()


   -------------

End If




2. BusinessRootDataSource_InsertObject. It calls Save method that returns 0 reccords affected and set properly text of label error.


3.DetailsView1_ItemInserted is invoked: it keeps DetailsView in insert mode: e.KeepInInsertMode = True


This is the right behaviour!


Second time when I press Insert Button, DetailsView1.DefaultMode is ReadOnly and DetailsView become invisible. BusinessRootDataSource_InsertObject and DetailsView1_ItemInserted are skipped! DetailsView1.Rows.Count became 0!

A similar behaviour has Cancel Button also. First time is working properly, but, the second time when is pressed it sets displayview default mode in readonly


 

 



 



 


Many Thanks and HNY for all of you! 


 


Thursday, January 08, 2015  |  From CSLA .NET Contrib

Hi,


I am working on a Mvc4-project and I am wondering why I rather should use the method SaveObject() instead of myObject = myObject.Save() when inserting or updating the db?


The beginning of my code in my controller looks like the following:


 


 


 


 


 


 


 


 


 


 


 


 



 



 



 


public class HomeController : Csla.Web.Mvc.Controller, IModelCreator

{



 



 



 


  public object CreateModel(Type modelType)

  {



 



 



 


    if (modelType.Equals(typeof(CustomerEdit)))

 



 



 


      return CustomerEdit.NewCustomer();

 



 



 


    else



 



 



 


      return Activator.CreateInstance(modelType);

  }


 



 



 



 


  public ViewResult Index()

  {



 



 



 


    return View();

  }



  [



 



HttpPost]

 



 



 


  public ViewResult Index(CustomerEdit model)

  {



 



 



 


    if (ModelState.IsValid)

    {



 



 



 



      SaveObject(model,



 



false);


    .


    .


    .


    .


and so on.



So again, my question in this example is why it is better to use 

      SaveObject(model, false);


instead of simply doing as usual


      model = model.Save();


 


Thanks,


Peter


Thursday, December 11, 2014  |  From CSLA .NET Contrib

Hello,


Our shop makes extensive use of CSLA.  We have written asp.net mvc, winforms, web services, etc all using CSLA.


One of the things that we are really struggling with is how to get back useful debugging information when an error occurs.  The thing that makes it complicated is that our a single application can pass through multiple application server "layers" to do what it needs.


For example, (and this is a real example), we have a winforms application that makes a call to a remote data portal.  Sometimes (ordering related), the data portal makes a call to a webservice on another machine.  The webservice makes another remote data portal call to a server inside our firewall. 


We have another scenario which is similar but in this case the UI is an asp.net mvc application and it hops to a diferent web service (REST based) but it calls the same final data portal as the above example.


My "holy grail" would be to get back object state and stacktrace information for ALL of the hops and log into a database somewhere.  The user  would just see a GUID or something that says (call tech support with this number) and we would be able to look it up and the log  would be have all of the information across all hops.


Right now we have to fire up a bunch of Visual Studio environments and point the data portal to production data to replicate the issues. 


I was thinking if we could override DataPortalException and add a GUID and then use implement IDataPortalExceptionInspector and change all of our configurations to call a custom exception that it would be the beginning of solving our problem.  But I am not able to get something like that to work so far (because the client side DataPortalException does not know how to deserialize the GUID property of the new exception type).  That was one of many errors I have encountered to try to get this to work.


Is there an easier way to do it?  Or am I on the right track?  I am not an engineer/architect so if you could give me an overview of the best solution that would be great.


We are testing this on the VERY NEWEST version of CSLA (4.5.601)  and .net 4.5.


Seth


 


 

Tuesday, December 09, 2014  |  From CSLA .NET Contrib

It seems to be inevitable that this will be a demand placed upon me and my team (though I sure plan to explore Xamarin.Forms or some other smart client cross-platform solution if one takes shape).  I will have to move our very large Silverlight application to HTML/JS.


For those that have used CSLA business objects with, say, an ASP.Net MVC application... is there a particular set of JavaScript frameworks/libraries that seem to work really well with CSLA business objects and those that do not work well?


At present, it seems like using Angular with Bootstrap is the flavor du jour that is more or less going to be dictated / but I don't want to just accept something without good reason.  Is Angular with Bootstrap as good as any to take on, or are there better JavaScript frameworks that make working with CSLA objects on the Web easier?


In the meantime, I will continue to hold out hope for something that won't have me writing JavaScript/HTML :).

Wednesday, November 19, 2014  |  From CSLA .NET Contrib

Hoping someone could offer some insight as I've been battling with this for some time.


I have a long term CSLA (4.5.6) web project that I'm trying to add the latest version of Application Insights. This was a simple process however it did not work. The site worked as usualt but nothing was posted to Application Insights, i.e there was an error in the HTTP Module added by AI, with no source I couldn't track this down.


After a long process of trial and error I narrowed it down to some binding redirect in the config file..


<dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
      </dependentAssembly>

Commenting this out resulted in Application Insights working however the site crashed completely. It seems Ai has a dependancy on the Microsoft.Bcl libraries (which incidently I didn't think were needed for 4.5) and adds the Microsoft.Threading.Tasks.*.dll's which kills CSLA.


Looking at CSLA source these are also referenced but never copied to bin folders.


Can anyone advise on the compatibility of the older .Net 4.0 async libs (ie Microsoft.Blc etc) and the CSLA. If I remove those dll;'s the app works again but Application Insights doesn't.


I don't think this is a CSLA issue but it would be nice to know what's going on. :(

Tuesday, November 18, 2014  |  From CSLA .NET Contrib

Hello


I would like to know how to use TransactionManager to manage a transaction on multiple oracle databases.I use TransactionManager for Root/Child transactions but on the same database, below is an example.


I don´t know how to set a TransactionManager that hold different connections object and that is able to commit or rollback the complete transaction. I think i have to use a UoW object but i don't how to wrap the complete process with one TransactionManager object.


Any help will be appreciated, thank in advance, Esteban


protected override void DataPortal_Update()
        {
            bool cancel = false;
            OnBeforeUpdate(ref cancel, this);
            if (cancel) return;
           
            RetailDto resultRetailDto = null;
           
         using (var ctx = DalFactory.GetManager())
         {
          var dal = ctx.GetProvider<IRetailDal>();
               
                using (var ctxConn = TransactionManager<OracleConnection, OracleTransaction>.GetManager(this.BreintekManager.ConnectStringDB, false, this.BreintekManager.DBConnId.ToString()))
                {
                    Csla.ApplicationContext.LocalContext[this.BreintekManager.DBConnId.ToString()] = "TransacOK";
          
                    using (BypassPropertyChecks)
                    {
                        RetailDto retailDto = new RetailDto(this.BreintekManager.CodigoAccesoSistema, this.BreintekManager.Usuario)
                        {
                            RetailId = this.RetailId,
                            ....
                        };
                       
                        retailDto.BreintekManager = this.BreintekManager;
                        retailDto.BreintekManager.AccionDB = BreintekAccionesDB.Update;                       
                       
                        retailDto.BreintekManager.EsTransaccion = true;
                       
                  resultRetailDto = dal.Update(retailDto);
                   
                        OnAfterUpdate(ref resultRetailDto);
                       
                        if(resultRetailDto.BreintekManager.TieneError)
                        {
                            if(resultRetailDto.BreintekManager.EsTransaccion)
                            {
                                var dalTrx = ctx.GetProvider<IManejoTransaccion>();
                                dalTrx.EjecutaTransaccion(resultRetailDto.BreintekManager, AdministraError.ListaErrorTrx);
                            }
                           
                            this.BreintekManager = resultRetailDto.BreintekManager;
                            ApplicationContext.LocalContext.Remove(this.BreintekManager.DBConnId.ToString());
                            return;
                        }
                    }
                   
                    cancel = false;
                    OnBeforeUpdateChild(ref cancel,  ref resultRetailDto);
                    if (cancel) return;


                    FieldManager.UpdateChildren(this);
                   
                    OnAfterUpdateChild(this, ref resultRetailDto);
               
                    if  ((!this.BreintekManager.TieneError) && (Csla.ApplicationContext.LocalContext[this.BreintekManager.DBConnId.ToString()].ToString() == "TransacOK"))
                    {
                        this.BreintekManager.Status = 1;
                        this.BreintekManager.OpcionDB = 0;
                        ctxConn.Commit();
                    }
                    else
                    {
                        this.BreintekManager.Status = -1;
                        this.BreintekManager.StatusMessage = String.Format("Se produjeron errores en objetos hijos.{0}{1}", Environment.NewLine, this.BreintekManager.StatusMessage);
                    }


                    ApplicationContext.LocalContext.Remove(this.BreintekManager.DBConnId.ToString());               
                }
            }
        }


 


 


 


 


 

Sunday, November 16, 2014  |  From CSLA .NET Contrib

I am running into a strange result. I have a business object with async rules. I am running unit tests to test basic crud operations. Update works fine. Insert gives me the Cannot save while IsBusy error. It seems IsBusy remains true even after the ValidationComplete event fires. Any ideas? Here is the code;


var validationCompleteEvent = new ManualResetEvent(false);


var item = MyEntity.New(Guid.NewGuid());


Assert.IsNotNull(item);


item.ValidationComplete += delegate { validationCompleteEvent.Set(); };


item.Name = "Test"; // Triggers the async rule.


validationCompleteEvent.WaitOne(5000,false);


item = item.Save(); // Get error here

Saturday, November 15, 2014  |  From CSLA .NET Contrib

Scenario: WinRT project with CSLA 4.5.


I've come across a weird situation where when I add one additional property to a particularly large object, the object breaks when the DP_Create method is called. It doesn't matter what kind of property I add (bool, int, whatever). The object has 58 properties, but when the 59th is added, I get an exception.


In a factory method on the object, I'm calling the DP_Create method as as follows:


var line = DataPortal.Create<OrderLineEdit>(criteria);


When this line is executed, I get back the following error without any chance of stepping into the DP_Create method even though a breakpoint is in there.


"An exception of type 'Csla.DataPortalException' occurred in mscorlib.dll but was not handled in user code


Additional information: DataPortal.Create failed (Object reference not set to an instance of an object.)"


I've spent hours going through the possibilities, including making sure all objects, including criteria objects, have default public constructors which I've found are needed in WinRT. The DP_Create method is run locally, per our custom proxy factory and by the fact it is in a compiler directive to run only NETFX_CORE, and I've even marked the method with the [RunLocal] attribute just to make sure, with that making no difference. Everything being done in this local DP_Create method does nothing spectacular (no database calls obviously, not interaction with other objects...simply setting simple type properties like ints, strings, etc.).


What I've finally stumbled onto is that when I remove a property (any property), everything starts working. And when I add a new property (of any data type, with any random name and not referenced by any code) it stops working and throws this exception. This leads me to the question of whether there is any sort of max # of properties allowed on an object running in the WinRT stack.


Any ideas? Thanks.

Tuesday, November 11, 2014  |  From CSLA .NET Contrib

when exist a VPN How affect our data acces layer or our WCF code?

Monday, November 10, 2014  |  From CSLA .NET Contrib

I am trying to find comparison data that compares the Entity framework and CSLA. Running head to head. Can't find anything. Anyone want to weigh in on this?


 


Dave

 CSLA .NET Contrib News Feed 

 Code-gen Templates News Feed 
Friday, January 30, 2015  |  From Code-gen Templates

(new to CSLA) - I am trying to do some collection validation, but it does not scale.  I would like to write my own method that will loop through the collection without firing any additional events and if I find an object is invalid, I would like to manually set the property to be invalid, which would be reflected through the interface. 

Thursday, January 29, 2015  |  From Code-gen Templates

Hi,


When I try to use DataPortal.ProxyModes as the second parameter in my DataPortal.BeginCreate() method I get the error "Unknown member 'ProxyModes' of 'Csla.DataPortal'"


Has ProxyModes been removed from Csla.DataPortal? I use version 4.5.601 of Csla.


Thanks,


Peter Centellini 

Monday, January 26, 2015  |  From Code-gen Templates

Hi guys, we are using Csla for our business objects, currently using version 3.8.4. There was a requirement to get property value into one of Child's Child object. I was trying to use IParent interface to climb up in hierarchy. But it seems to me i am doing some thing wrong or may be i missed something. Please find attached console test application. i commented out the access path in objB.CheckBsParent() method.


A quick response will be appreciated.


 


Regards.

Thursday, January 22, 2015  |  From Code-gen Templates

Hi,


I have read on many posts about the error message that it is there because we try to write to a collection when it is in ReadOnly mode.


In my case I am setting a property and after that using PropertyHasChanged(string item) method


where the error comes.


The class in which we have used the validation is inheritted from BusinessBAse.


I would like to know where is the best place to set ReadOnlyP propert to False and 


which method shoul I implement and if you can let me know how.


I would appreciate,


Thanks in advance.

Thursday, January 22, 2015  |  From Code-gen Templates

Been using 2.0 framework for quite a few years (obviously).  I am trying to move to to version 3.05 but I am unable to compile due to error.  No modifications have been made to the code.  The error preventing compilation is:


Class: ObjectAdapter


Sub: Fill


Line: 25 className = TypeName (source)


Error: System.RunTime.Serialization.TypeName is not accessible in this context because it is Private.


Anyone have any idea why this is happening?


Appreciate anyone's help.


Jim

Sunday, January 18, 2015  |  From Code-gen Templates

Hi all,


I wonder whether one must really use BindingSource under Windows Forms. Did anyone try doing it without BindingSource?

Saturday, January 17, 2015  |  From Code-gen Templates

Does any one has sample or a resource link how to integrate WPF DataGrid with CSLA MVVM but using Caliburn Micro ?


-The model from Viewmodel is to be assigned to a Model Collectiion View Source on the event Model_Changed


-The Grid will bind to Model Collection View Source


-I looked at http://forums.lhotka.net/forums/p/9985/46825.aspx#46825, they are binding it to a observable collection, but I found issues binding grid to a collection view source for the model of the view model


-Are there any conventions with Data Grid binding with caliburn ? The link did not mention datasource/itemsouce on the data grid but the name of the grid matched observable collection . I wanted to know all such conventions.


Kindly suggest  


 

Thursday, January 15, 2015  |  From Code-gen Templates

I know that this capability has been added to CSLA 4.x with the inclusion of the IDataPortalExceptionInspector.  We have an old "legacy" project using CSLA 3.0.x (but which I just verified today could be upgraded to 3.8 in a couple of hours if need be).


We would like to add server-side data portal exception logging (since the server is in our dmz which has access to our database where we can log it. )


Can this be done in 3.8x?  I was hoping that it would raise some kind of exception event that we could subscribe too but I don't see anything.


It is NOT a have-to-do item but would be nice.  Any ideas?


Seth


 

Thursday, January 15, 2015  |  From Code-gen Templates

Version 4.5.680-Beta is now available via NuGet.


A list of changes is here:


https://github.com/MarimerLLC/csla/issues?q=is%3Aissue+milestone%3A4.5.700+is%3Aclosed


This release adds support for the new Xamarin universal runtime and project types. It also includes some other bug fixes and minor enhancements.

Wednesday, January 14, 2015  |  From Code-gen Templates

I'm hoping someone can correct my ignorance here.


I have upgraded my solution from EF5 to EF6.


I am using ObjectContextManager in my data layer, database-first with an edmx model.


To upgrade to EF6 I followed the guide on MSDN: http://msdn.microsoft.com/en-us/data/upgradeef6.aspx


So now, in my model,


public partial class StoreDataContext : ObjectContext


"ObjectContext" refers to System.Data.Entity.Core.Objects.ObjectContext. Good so far.


However, in my Dal I now have errors everywhere:


using (var ctx = ObjectContextManager<StoreDataContext>.GetManager("StoreDataContext"))


There error is: The type 'Store.DataAccess.Ef.StoreDataContext' must be convertible to type 'System.Data.Objects.ObjectContext' in order to use it as parameter 'C' in the generic class 'Csla.Data.ObjectContextmanager<C>'


Hmm. I tried referencing the Csla.Data.EF6 library, assuming there was something in it that I could use, but it only contains DbContextManager. I need ObjectContextManager - changing to DbContextManager would require massive changes in all my Dal code.


Can someone help?


 

Sunday, January 11, 2015  |  From Code-gen Templates

Hello everybody,


I started to use the ProjectEdit functionality exposed by Rocky in WEB ProjectTracker project. But DetailsView control give me an ugly issue: Insert and Update are working fine only for the first press of these buttons.  My object has errors so, when I press insert button first time, all error are displayed properly in label error. If I will press insert button again, details view become invisible.


Bellow is the list of events when I press insert button first time:


1. DetailsView1_ItemCreated. It allows to fill values of controls from DetailsView:



If DetailsView1.DefaultMode = DetailsViewMode.Insert Then


   Dim obj As RootObject = GetObject()


   -------------

End If




2. BusinessRootDataSource_InsertObject. It calls Save method that returns 0 reccords affected and set properly text of label error.


3.DetailsView1_ItemInserted is invoked: it keeps DetailsView in insert mode: e.KeepInInsertMode = True


This is the right behaviour!


Second time when I press Insert Button, DetailsView1.DefaultMode is ReadOnly and DetailsView become invisible. BusinessRootDataSource_InsertObject and DetailsView1_ItemInserted are skipped! DetailsView1.Rows.Count became 0!

A similar behaviour has Cancel Button also. First time is working properly, but, the second time when is pressed it sets displayview default mode in readonly


 

 



 



 


Many Thanks and HNY for all of you! 


 


Thursday, January 08, 2015  |  From Code-gen Templates

Hi,


I am working on a Mvc4-project and I am wondering why I rather should use the method SaveObject() instead of myObject = myObject.Save() when inserting or updating the db?


The beginning of my code in my controller looks like the following:


 


 


 


 


 


 


 


 


 


 


 


 



 



 



 


public class HomeController : Csla.Web.Mvc.Controller, IModelCreator

{



 



 



 


  public object CreateModel(Type modelType)

  {



 



 



 


    if (modelType.Equals(typeof(CustomerEdit)))

 



 



 


      return CustomerEdit.NewCustomer();

 



 



 


    else



 



 



 


      return Activator.CreateInstance(modelType);

  }


 



 



 



 


  public ViewResult Index()

  {



 



 



 


    return View();

  }



  [



 



HttpPost]

 



 



 


  public ViewResult Index(CustomerEdit model)

  {



 



 



 


    if (ModelState.IsValid)

    {



 



 



 



      SaveObject(model,



 



false);


    .


    .


    .


    .


and so on.



So again, my question in this example is why it is better to use 

      SaveObject(model, false);


instead of simply doing as usual


      model = model.Save();


 


Thanks,


Peter


Thursday, December 11, 2014  |  From Code-gen Templates

Hello,


Our shop makes extensive use of CSLA.  We have written asp.net mvc, winforms, web services, etc all using CSLA.


One of the things that we are really struggling with is how to get back useful debugging information when an error occurs.  The thing that makes it complicated is that our a single application can pass through multiple application server "layers" to do what it needs.


For example, (and this is a real example), we have a winforms application that makes a call to a remote data portal.  Sometimes (ordering related), the data portal makes a call to a webservice on another machine.  The webservice makes another remote data portal call to a server inside our firewall. 


We have another scenario which is similar but in this case the UI is an asp.net mvc application and it hops to a diferent web service (REST based) but it calls the same final data portal as the above example.


My "holy grail" would be to get back object state and stacktrace information for ALL of the hops and log into a database somewhere.  The user  would just see a GUID or something that says (call tech support with this number) and we would be able to look it up and the log  would be have all of the information across all hops.


Right now we have to fire up a bunch of Visual Studio environments and point the data portal to production data to replicate the issues. 


I was thinking if we could override DataPortalException and add a GUID and then use implement IDataPortalExceptionInspector and change all of our configurations to call a custom exception that it would be the beginning of solving our problem.  But I am not able to get something like that to work so far (because the client side DataPortalException does not know how to deserialize the GUID property of the new exception type).  That was one of many errors I have encountered to try to get this to work.


Is there an easier way to do it?  Or am I on the right track?  I am not an engineer/architect so if you could give me an overview of the best solution that would be great.


We are testing this on the VERY NEWEST version of CSLA (4.5.601)  and .net 4.5.


Seth


 


 

Tuesday, December 09, 2014  |  From Code-gen Templates

It seems to be inevitable that this will be a demand placed upon me and my team (though I sure plan to explore Xamarin.Forms or some other smart client cross-platform solution if one takes shape).  I will have to move our very large Silverlight application to HTML/JS.


For those that have used CSLA business objects with, say, an ASP.Net MVC application... is there a particular set of JavaScript frameworks/libraries that seem to work really well with CSLA business objects and those that do not work well?


At present, it seems like using Angular with Bootstrap is the flavor du jour that is more or less going to be dictated / but I don't want to just accept something without good reason.  Is Angular with Bootstrap as good as any to take on, or are there better JavaScript frameworks that make working with CSLA objects on the Web easier?


In the meantime, I will continue to hold out hope for something that won't have me writing JavaScript/HTML :).

Wednesday, November 19, 2014  |  From Code-gen Templates

Hoping someone could offer some insight as I've been battling with this for some time.


I have a long term CSLA (4.5.6) web project that I'm trying to add the latest version of Application Insights. This was a simple process however it did not work. The site worked as usualt but nothing was posted to Application Insights, i.e there was an error in the HTTP Module added by AI, with no source I couldn't track this down.


After a long process of trial and error I narrowed it down to some binding redirect in the config file..


<dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
      </dependentAssembly>

Commenting this out resulted in Application Insights working however the site crashed completely. It seems Ai has a dependancy on the Microsoft.Bcl libraries (which incidently I didn't think were needed for 4.5) and adds the Microsoft.Threading.Tasks.*.dll's which kills CSLA.


Looking at CSLA source these are also referenced but never copied to bin folders.


Can anyone advise on the compatibility of the older .Net 4.0 async libs (ie Microsoft.Blc etc) and the CSLA. If I remove those dll;'s the app works again but Application Insights doesn't.


I don't think this is a CSLA issue but it would be nice to know what's going on. :(

Tuesday, November 18, 2014  |  From Code-gen Templates

Hello


I would like to know how to use TransactionManager to manage a transaction on multiple oracle databases.I use TransactionManager for Root/Child transactions but on the same database, below is an example.


I don´t know how to set a TransactionManager that hold different connections object and that is able to commit or rollback the complete transaction. I think i have to use a UoW object but i don't how to wrap the complete process with one TransactionManager object.


Any help will be appreciated, thank in advance, Esteban


protected override void DataPortal_Update()
        {
            bool cancel = false;
            OnBeforeUpdate(ref cancel, this);
            if (cancel) return;
           
            RetailDto resultRetailDto = null;
           
         using (var ctx = DalFactory.GetManager())
         {
          var dal = ctx.GetProvider<IRetailDal>();
               
                using (var ctxConn = TransactionManager<OracleConnection, OracleTransaction>.GetManager(this.BreintekManager.ConnectStringDB, false, this.BreintekManager.DBConnId.ToString()))
                {
                    Csla.ApplicationContext.LocalContext[this.BreintekManager.DBConnId.ToString()] = "TransacOK";
          
                    using (BypassPropertyChecks)
                    {
                        RetailDto retailDto = new RetailDto(this.BreintekManager.CodigoAccesoSistema, this.BreintekManager.Usuario)
                        {
                            RetailId = this.RetailId,
                            ....
                        };
                       
                        retailDto.BreintekManager = this.BreintekManager;
                        retailDto.BreintekManager.AccionDB = BreintekAccionesDB.Update;                       
                       
                        retailDto.BreintekManager.EsTransaccion = true;
                       
                  resultRetailDto = dal.Update(retailDto);
                   
                        OnAfterUpdate(ref resultRetailDto);
                       
                        if(resultRetailDto.BreintekManager.TieneError)
                        {
                            if(resultRetailDto.BreintekManager.EsTransaccion)
                            {
                                var dalTrx = ctx.GetProvider<IManejoTransaccion>();
                                dalTrx.EjecutaTransaccion(resultRetailDto.BreintekManager, AdministraError.ListaErrorTrx);
                            }
                           
                            this.BreintekManager = resultRetailDto.BreintekManager;
                            ApplicationContext.LocalContext.Remove(this.BreintekManager.DBConnId.ToString());
                            return;
                        }
                    }
                   
                    cancel = false;
                    OnBeforeUpdateChild(ref cancel,  ref resultRetailDto);
                    if (cancel) return;


                    FieldManager.UpdateChildren(this);
                   
                    OnAfterUpdateChild(this, ref resultRetailDto);
               
                    if  ((!this.BreintekManager.TieneError) && (Csla.ApplicationContext.LocalContext[this.BreintekManager.DBConnId.ToString()].ToString() == "TransacOK"))
                    {
                        this.BreintekManager.Status = 1;
                        this.BreintekManager.OpcionDB = 0;
                        ctxConn.Commit();
                    }
                    else
                    {
                        this.BreintekManager.Status = -1;
                        this.BreintekManager.StatusMessage = String.Format("Se produjeron errores en objetos hijos.{0}{1}", Environment.NewLine, this.BreintekManager.StatusMessage);
                    }


                    ApplicationContext.LocalContext.Remove(this.BreintekManager.DBConnId.ToString());               
                }
            }
        }


 


 


 


 


 

Sunday, November 16, 2014  |  From Code-gen Templates

I am running into a strange result. I have a business object with async rules. I am running unit tests to test basic crud operations. Update works fine. Insert gives me the Cannot save while IsBusy error. It seems IsBusy remains true even after the ValidationComplete event fires. Any ideas? Here is the code;


var validationCompleteEvent = new ManualResetEvent(false);


var item = MyEntity.New(Guid.NewGuid());


Assert.IsNotNull(item);


item.ValidationComplete += delegate { validationCompleteEvent.Set(); };


item.Name = "Test"; // Triggers the async rule.


validationCompleteEvent.WaitOne(5000,false);


item = item.Save(); // Get error here

Saturday, November 15, 2014  |  From Code-gen Templates

Scenario: WinRT project with CSLA 4.5.


I've come across a weird situation where when I add one additional property to a particularly large object, the object breaks when the DP_Create method is called. It doesn't matter what kind of property I add (bool, int, whatever). The object has 58 properties, but when the 59th is added, I get an exception.


In a factory method on the object, I'm calling the DP_Create method as as follows:


var line = DataPortal.Create<OrderLineEdit>(criteria);


When this line is executed, I get back the following error without any chance of stepping into the DP_Create method even though a breakpoint is in there.


"An exception of type 'Csla.DataPortalException' occurred in mscorlib.dll but was not handled in user code


Additional information: DataPortal.Create failed (Object reference not set to an instance of an object.)"


I've spent hours going through the possibilities, including making sure all objects, including criteria objects, have default public constructors which I've found are needed in WinRT. The DP_Create method is run locally, per our custom proxy factory and by the fact it is in a compiler directive to run only NETFX_CORE, and I've even marked the method with the [RunLocal] attribute just to make sure, with that making no difference. Everything being done in this local DP_Create method does nothing spectacular (no database calls obviously, not interaction with other objects...simply setting simple type properties like ints, strings, etc.).


What I've finally stumbled onto is that when I remove a property (any property), everything starts working. And when I add a new property (of any data type, with any random name and not referenced by any code) it stops working and throws this exception. This leads me to the question of whether there is any sort of max # of properties allowed on an object running in the WinRT stack.


Any ideas? Thanks.

Tuesday, November 11, 2014  |  From Code-gen Templates

when exist a VPN How affect our data acces layer or our WCF code?

Monday, November 10, 2014  |  From Code-gen Templates

I am trying to find comparison data that compares the Entity framework and CSLA. Running head to head. Can't find anything. Anyone want to weigh in on this?


 


Dave

 Code-gen Templates News Feed 

 VS Templates News Feed 
Friday, January 30, 2015  |  From VS Templates

(new to CSLA) - I am trying to do some collection validation, but it does not scale.  I would like to write my own method that will loop through the collection without firing any additional events and if I find an object is invalid, I would like to manually set the property to be invalid, which would be reflected through the interface. 

Thursday, January 29, 2015  |  From VS Templates

Hi,


When I try to use DataPortal.ProxyModes as the second parameter in my DataPortal.BeginCreate() method I get the error "Unknown member 'ProxyModes' of 'Csla.DataPortal'"


Has ProxyModes been removed from Csla.DataPortal? I use version 4.5.601 of Csla.


Thanks,


Peter Centellini 

Monday, January 26, 2015  |  From VS Templates

Hi guys, we are using Csla for our business objects, currently using version 3.8.4. There was a requirement to get property value into one of Child's Child object. I was trying to use IParent interface to climb up in hierarchy. But it seems to me i am doing some thing wrong or may be i missed something. Please find attached console test application. i commented out the access path in objB.CheckBsParent() method.


A quick response will be appreciated.


 


Regards.

Thursday, January 22, 2015  |  From VS Templates

Hi,


I have read on many posts about the error message that it is there because we try to write to a collection when it is in ReadOnly mode.


In my case I am setting a property and after that using PropertyHasChanged(string item) method


where the error comes.


The class in which we have used the validation is inheritted from BusinessBAse.


I would like to know where is the best place to set ReadOnlyP propert to False and 


which method shoul I implement and if you can let me know how.


I would appreciate,


Thanks in advance.

Thursday, January 22, 2015  |  From VS Templates

Been using 2.0 framework for quite a few years (obviously).  I am trying to move to to version 3.05 but I am unable to compile due to error.  No modifications have been made to the code.  The error preventing compilation is:


Class: ObjectAdapter


Sub: Fill


Line: 25 className = TypeName (source)


Error: System.RunTime.Serialization.TypeName is not accessible in this context because it is Private.


Anyone have any idea why this is happening?


Appreciate anyone's help.


Jim

Sunday, January 18, 2015  |  From VS Templates

Hi all,


I wonder whether one must really use BindingSource under Windows Forms. Did anyone try doing it without BindingSource?

Saturday, January 17, 2015  |  From VS Templates

Does any one has sample or a resource link how to integrate WPF DataGrid with CSLA MVVM but using Caliburn Micro ?


-The model from Viewmodel is to be assigned to a Model Collectiion View Source on the event Model_Changed


-The Grid will bind to Model Collection View Source


-I looked at http://forums.lhotka.net/forums/p/9985/46825.aspx#46825, they are binding it to a observable collection, but I found issues binding grid to a collection view source for the model of the view model


-Are there any conventions with Data Grid binding with caliburn ? The link did not mention datasource/itemsouce on the data grid but the name of the grid matched observable collection . I wanted to know all such conventions.


Kindly suggest  


 

Thursday, January 15, 2015  |  From VS Templates

I know that this capability has been added to CSLA 4.x with the inclusion of the IDataPortalExceptionInspector.  We have an old "legacy" project using CSLA 3.0.x (but which I just verified today could be upgraded to 3.8 in a couple of hours if need be).


We would like to add server-side data portal exception logging (since the server is in our dmz which has access to our database where we can log it. )


Can this be done in 3.8x?  I was hoping that it would raise some kind of exception event that we could subscribe too but I don't see anything.


It is NOT a have-to-do item but would be nice.  Any ideas?


Seth


 

Thursday, January 15, 2015  |  From VS Templates

Version 4.5.680-Beta is now available via NuGet.


A list of changes is here:


https://github.com/MarimerLLC/csla/issues?q=is%3Aissue+milestone%3A4.5.700+is%3Aclosed


This release adds support for the new Xamarin universal runtime and project types. It also includes some other bug fixes and minor enhancements.

Wednesday, January 14, 2015  |  From VS Templates

I'm hoping someone can correct my ignorance here.


I have upgraded my solution from EF5 to EF6.


I am using ObjectContextManager in my data layer, database-first with an edmx model.


To upgrade to EF6 I followed the guide on MSDN: http://msdn.microsoft.com/en-us/data/upgradeef6.aspx


So now, in my model,


public partial class StoreDataContext : ObjectContext


"ObjectContext" refers to System.Data.Entity.Core.Objects.ObjectContext. Good so far.


However, in my Dal I now have errors everywhere:


using (var ctx = ObjectContextManager<StoreDataContext>.GetManager("StoreDataContext"))


There error is: The type 'Store.DataAccess.Ef.StoreDataContext' must be convertible to type 'System.Data.Objects.ObjectContext' in order to use it as parameter 'C' in the generic class 'Csla.Data.ObjectContextmanager<C>'


Hmm. I tried referencing the Csla.Data.EF6 library, assuming there was something in it that I could use, but it only contains DbContextManager. I need ObjectContextManager - changing to DbContextManager would require massive changes in all my Dal code.


Can someone help?


 

Sunday, January 11, 2015  |  From VS Templates

Hello everybody,


I started to use the ProjectEdit functionality exposed by Rocky in WEB ProjectTracker project. But DetailsView control give me an ugly issue: Insert and Update are working fine only for the first press of these buttons.  My object has errors so, when I press insert button first time, all error are displayed properly in label error. If I will press insert button again, details view become invisible.


Bellow is the list of events when I press insert button first time:


1. DetailsView1_ItemCreated. It allows to fill values of controls from DetailsView:



If DetailsView1.DefaultMode = DetailsViewMode.Insert Then


   Dim obj As RootObject = GetObject()


   -------------

End If




2. BusinessRootDataSource_InsertObject. It calls Save method that returns 0 reccords affected and set properly text of label error.


3.DetailsView1_ItemInserted is invoked: it keeps DetailsView in insert mode: e.KeepInInsertMode = True


This is the right behaviour!


Second time when I press Insert Button, DetailsView1.DefaultMode is ReadOnly and DetailsView become invisible. BusinessRootDataSource_InsertObject and DetailsView1_ItemInserted are skipped! DetailsView1.Rows.Count became 0!

A similar behaviour has Cancel Button also. First time is working properly, but, the second time when is pressed it sets displayview default mode in readonly


 

 



 



 


Many Thanks and HNY for all of you! 


 


Thursday, January 08, 2015  |  From VS Templates

Hi,


I am working on a Mvc4-project and I am wondering why I rather should use the method SaveObject() instead of myObject = myObject.Save() when inserting or updating the db?


The beginning of my code in my controller looks like the following:


 


 


 


 


 


 


 


 


 


 


 


 



 



 



 


public class HomeController : Csla.Web.Mvc.Controller, IModelCreator

{



 



 



 


  public object CreateModel(Type modelType)

  {



 



 



 


    if (modelType.Equals(typeof(CustomerEdit)))

 



 



 


      return CustomerEdit.NewCustomer();

 



 



 


    else



 



 



 


      return Activator.CreateInstance(modelType);

  }


 



 



 



 


  public ViewResult Index()

  {



 



 



 


    return View();

  }



  [



 



HttpPost]

 



 



 


  public ViewResult Index(CustomerEdit model)

  {



 



 



 


    if (ModelState.IsValid)

    {



 



 



 



      SaveObject(model,



 



false);


    .


    .


    .


    .


and so on.



So again, my question in this example is why it is better to use 

      SaveObject(model, false);


instead of simply doing as usual


      model = model.Save();


 


Thanks,


Peter


Thursday, December 11, 2014  |  From VS Templates

Hello,


Our shop makes extensive use of CSLA.  We have written asp.net mvc, winforms, web services, etc all using CSLA.


One of the things that we are really struggling with is how to get back useful debugging information when an error occurs.  The thing that makes it complicated is that our a single application can pass through multiple application server "layers" to do what it needs.


For example, (and this is a real example), we have a winforms application that makes a call to a remote data portal.  Sometimes (ordering related), the data portal makes a call to a webservice on another machine.  The webservice makes another remote data portal call to a server inside our firewall. 


We have another scenario which is similar but in this case the UI is an asp.net mvc application and it hops to a diferent web service (REST based) but it calls the same final data portal as the above example.


My "holy grail" would be to get back object state and stacktrace information for ALL of the hops and log into a database somewhere.  The user  would just see a GUID or something that says (call tech support with this number) and we would be able to look it up and the log  would be have all of the information across all hops.


Right now we have to fire up a bunch of Visual Studio environments and point the data portal to production data to replicate the issues. 


I was thinking if we could override DataPortalException and add a GUID and then use implement IDataPortalExceptionInspector and change all of our configurations to call a custom exception that it would be the beginning of solving our problem.  But I am not able to get something like that to work so far (because the client side DataPortalException does not know how to deserialize the GUID property of the new exception type).  That was one of many errors I have encountered to try to get this to work.


Is there an easier way to do it?  Or am I on the right track?  I am not an engineer/architect so if you could give me an overview of the best solution that would be great.


We are testing this on the VERY NEWEST version of CSLA (4.5.601)  and .net 4.5.


Seth


 


 

Tuesday, December 09, 2014  |  From VS Templates

It seems to be inevitable that this will be a demand placed upon me and my team (though I sure plan to explore Xamarin.Forms or some other smart client cross-platform solution if one takes shape).  I will have to move our very large Silverlight application to HTML/JS.


For those that have used CSLA business objects with, say, an ASP.Net MVC application... is there a particular set of JavaScript frameworks/libraries that seem to work really well with CSLA business objects and those that do not work well?


At present, it seems like using Angular with Bootstrap is the flavor du jour that is more or less going to be dictated / but I don't want to just accept something without good reason.  Is Angular with Bootstrap as good as any to take on, or are there better JavaScript frameworks that make working with CSLA objects on the Web easier?


In the meantime, I will continue to hold out hope for something that won't have me writing JavaScript/HTML :).

Wednesday, November 19, 2014  |  From VS Templates

Hoping someone could offer some insight as I've been battling with this for some time.


I have a long term CSLA (4.5.6) web project that I'm trying to add the latest version of Application Insights. This was a simple process however it did not work. The site worked as usualt but nothing was posted to Application Insights, i.e there was an error in the HTTP Module added by AI, with no source I couldn't track this down.


After a long process of trial and error I narrowed it down to some binding redirect in the config file..


<dependentAssembly>
        <assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.5.19.0" newVersion="2.5.19.0" />
      </dependentAssembly>

Commenting this out resulted in Application Insights working however the site crashed completely. It seems Ai has a dependancy on the Microsoft.Bcl libraries (which incidently I didn't think were needed for 4.5) and adds the Microsoft.Threading.Tasks.*.dll's which kills CSLA.


Looking at CSLA source these are also referenced but never copied to bin folders.


Can anyone advise on the compatibility of the older .Net 4.0 async libs (ie Microsoft.Blc etc) and the CSLA. If I remove those dll;'s the app works again but Application Insights doesn't.


I don't think this is a CSLA issue but it would be nice to know what's going on. :(

Tuesday, November 18, 2014  |  From VS Templates

Hello


I would like to know how to use TransactionManager to manage a transaction on multiple oracle databases.I use TransactionManager for Root/Child transactions but on the same database, below is an example.


I don´t know how to set a TransactionManager that hold different connections object and that is able to commit or rollback the complete transaction. I think i have to use a UoW object but i don't how to wrap the complete process with one TransactionManager object.


Any help will be appreciated, thank in advance, Esteban


protected override void DataPortal_Update()
        {
            bool cancel = false;
            OnBeforeUpdate(ref cancel, this);
            if (cancel) return;
           
            RetailDto resultRetailDto = null;
           
         using (var ctx = DalFactory.GetManager())
         {
          var dal = ctx.GetProvider<IRetailDal>();
               
                using (var ctxConn = TransactionManager<OracleConnection, OracleTransaction>.GetManager(this.BreintekManager.ConnectStringDB, false, this.BreintekManager.DBConnId.ToString()))
                {
                    Csla.ApplicationContext.LocalContext[this.BreintekManager.DBConnId.ToString()] = "TransacOK";
          
                    using (BypassPropertyChecks)
                    {
                        RetailDto retailDto = new RetailDto(this.BreintekManager.CodigoAccesoSistema, this.BreintekManager.Usuario)
                        {
                            RetailId = this.RetailId,
                            ....
                        };
                       
                        retailDto.BreintekManager = this.BreintekManager;
                        retailDto.BreintekManager.AccionDB = BreintekAccionesDB.Update;                       
                       
                        retailDto.BreintekManager.EsTransaccion = true;
                       
                  resultRetailDto = dal.Update(retailDto);
                   
                        OnAfterUpdate(ref resultRetailDto);
                       
                        if(resultRetailDto.BreintekManager.TieneError)
                        {
                            if(resultRetailDto.BreintekManager.EsTransaccion)
                            {
                                var dalTrx = ctx.GetProvider<IManejoTransaccion>();
                                dalTrx.EjecutaTransaccion(resultRetailDto.BreintekManager, AdministraError.ListaErrorTrx);
                            }
                           
                            this.BreintekManager = resultRetailDto.BreintekManager;
                            ApplicationContext.LocalContext.Remove(this.BreintekManager.DBConnId.ToString());
                            return;
                        }
                    }
                   
                    cancel = false;
                    OnBeforeUpdateChild(ref cancel,  ref resultRetailDto);
                    if (cancel) return;


                    FieldManager.UpdateChildren(this);
                   
                    OnAfterUpdateChild(this, ref resultRetailDto);
               
                    if  ((!this.BreintekManager.TieneError) && (Csla.ApplicationContext.LocalContext[this.BreintekManager.DBConnId.ToString()].ToString() == "TransacOK"))
                    {
                        this.BreintekManager.Status = 1;
                        this.BreintekManager.OpcionDB = 0;
                        ctxConn.Commit();
                    }
                    else
                    {
                        this.BreintekManager.Status = -1;
                        this.BreintekManager.StatusMessage = String.Format("Se produjeron errores en objetos hijos.{0}{1}", Environment.NewLine, this.BreintekManager.StatusMessage);
                    }


                    ApplicationContext.LocalContext.Remove(this.BreintekManager.DBConnId.ToString());               
                }
            }
        }


 


 


 


 


 

Sunday, November 16, 2014  |  From VS Templates

I am running into a strange result. I have a business object with async rules. I am running unit tests to test basic crud operations. Update works fine. Insert gives me the Cannot save while IsBusy error. It seems IsBusy remains true even after the ValidationComplete event fires. Any ideas? Here is the code;


var validationCompleteEvent = new ManualResetEvent(false);


var item = MyEntity.New(Guid.NewGuid());


Assert.IsNotNull(item);


item.ValidationComplete += delegate { validationCompleteEvent.Set(); };


item.Name = "Test"; // Triggers the async rule.


validationCompleteEvent.WaitOne(5000,false);


item = item.Save(); // Get error here

Saturday, November 15, 2014  |  From VS Templates

Scenario: WinRT project with CSLA 4.5.


I've come across a weird situation where when I add one additional property to a particularly large object, the object breaks when the DP_Create method is called. It doesn't matter what kind of property I add (bool, int, whatever). The object has 58 properties, but when the 59th is added, I get an exception.


In a factory method on the object, I'm calling the DP_Create method as as follows:


var line = DataPortal.Create<OrderLineEdit>(criteria);


When this line is executed, I get back the following error without any chance of stepping into the DP_Create method even though a breakpoint is in there.


"An exception of type 'Csla.DataPortalException' occurred in mscorlib.dll but was not handled in user code


Additional information: DataPortal.Create failed (Object reference not set to an instance of an object.)"


I've spent hours going through the possibilities, including making sure all objects, including criteria objects, have default public constructors which I've found are needed in WinRT. The DP_Create method is run locally, per our custom proxy factory and by the fact it is in a compiler directive to run only NETFX_CORE, and I've even marked the method with the [RunLocal] attribute just to make sure, with that making no difference. Everything being done in this local DP_Create method does nothing spectacular (no database calls obviously, not interaction with other objects...simply setting simple type properties like ints, strings, etc.).


What I've finally stumbled onto is that when I remove a property (any property), everything starts working. And when I add a new property (of any data type, with any random name and not referenced by any code) it stops working and throws this exception. This leads me to the question of whether there is any sort of max # of properties allowed on an object running in the WinRT stack.


Any ideas? Thanks.

Tuesday, November 11, 2014  |  From VS Templates

when exist a VPN How affect our data acces layer or our WCF code?

Monday, November 10, 2014  |  From VS Templates

I am trying to find comparison data that compares the Entity framework and CSLA. Running head to head. Can't find anything. Anyone want to weigh in on this?


 


Dave

 VS Templates News Feed 

Last edited Jan 18, 2007 at 7:55 PM by RockfordLhotka, version 2

Comments

No comments yet.