CSLA .NET Contrib News Feed 
Tuesday, October 21, 2014  |  From CSLA .NET Contrib

I have asked this question before (twice, I think) but have never got an answer to the question:


Before upgrading from 4 to 4.5, exceptions coming back from the data portal would have the message of the original exception such as "Another user has modified the row in Table1, update failed".  Now all that comes back as the message is than an Async Error occurred (the message is blank and the exception is thrown from System.Runtime.CompilerServices.AsyncServices.<ThrowAsync>).  There is no detail as to the problem.  The Async exception doesn't contain the original exception:  there is no internal exception. 


If something happens on the server like it cannot connect to SQL Server or some UNC path doesn't exist, no message is returned to the UI to indicate the problem. 


I would REALLY like an example on how to get the exception back or an explanation of what I may be doing wrong. 


Thanks.


Todd

Monday, October 20, 2014  |  From CSLA .NET Contrib

I'm working with CSLA 4.5.601 and recently found out a bug in the Create of SimpleDataPortal. (I did something wrong but exception was hard to track because of this)


Exception was catched as expected to line 91:
catch (Exception ex) {
  ...
  throw 
DataPortal.NewDataPortalException(...


And after that run the finally:
finally{
    ApplicationContext
.DataPortalActivator.FinalizeInstance(obj.Instance);
}

But because obj was null exception was thrown from the finally block and the exception from the try/catch was 'lost'.


I've added a null check in the finally block which could prevent an issue like this in the future
finally{
  if (obj != null)
  ApplicationContext
.DataPortalActivator.FinalizeInstance(obj.Instance);
}

Would this be a nice fix?

Friday, October 17, 2014  |  From CSLA .NET Contrib

Hi,


In my MVC 5-Project I want to use MS Identity for Authorization and Authentication. I have built my application according to the EncapsulatedDto-model, hence I among my projects have a Dal, DalSql, Library, and WcfPortal Project.  


I'm want to use Claims-based Authorization, and could of course put Everything in the MVC-Project since MS Identity with its EF-approach is separated from my other database,but then I break my separation of logic, so this is not the way to go as I see it.


I want to use the Identiy and Principal classes in CSLA, and separate all security logic from the UI-part, but am a Little unsure which way to go. The way I'm thinking is to have the usual Identity and Principal classes (inheriting from CslaIdentityBase and CslaPrincipal), in my Library Project, and then create a separate Concrete DalSqlEf-project which only handles the security parts.  


What are your comments on this?


Thanks,


Peter Centellini

Thursday, October 16, 2014  |  From CSLA .NET Contrib

I have a Telerik Grid with sum totals on the footer.  When a value in a child is changed the Grid does not recalculate the total.  The Grid requires a CollectionChanged event.  Is there a way to fire the event even though the list really did not change?  Here is a code example that doesn't work because the event is not accessible:


 


        /// <summary>


        /// The on child changed.


        /// </summary>


        /// <param name="e">


        /// The event args.


        /// </param>


        protected override void OnChildChanged(Csla.Core.ChildChangedEventArgs e)


        {


            if (CollectionChanged != null)


            {


                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace));


            }


        }


 


Todd


 

Thursday, October 16, 2014  |  From CSLA .NET Contrib

I've several projects spread out over VS2008 and VS2012.  Some of these projects are Silverlight projects/ASP/Windows Forms.   We'll be using Windows 7 for the foreseeable future.   Any advice when it comes to moving stuff over to a new technology?   What version of VS should I jump to and what would you recommend for a new desktop technology?   I really, really don't want to move everything to HTML.

Wednesday, October 15, 2014  |  From CSLA .NET Contrib

I'm trying to move from WCF because of Windows Phone, my app needed the AuthorizeDataPortal to reconstruct the user so I get the information I need to continue.


 


It seems that the HTTP Proxy does not agree with the AuthorizeDataPortal, is there another way?


Everytime i try to use it i get back a NULL object from the HTTPProxy call


any pointers?


 


 

Tuesday, October 14, 2014  |  From CSLA .NET Contrib

We are just upgrading from an older version of CSLA to the new framework (4.5.6) and having a little difficulty with one scenario.


I have a CSLA class (Model) referencing properties on another CSLA class (Relation) as a private backing field. The registration is setup like this:


Public Shared ReadOnly ReferenceProperty As PropertyInfo(Of ReferenceType) = RegisterProperty(Of ReferenceType)(Function(c) c.ReferenceType, "Reference Type", RelationshipTypes.PrivateField)
        Public Property ReferenceType() As ReferenceType
            Get
                Return GetProperty(ReferenceProperty,_reference.ReferenceType)
            End Get
            Set(ByVal value As ReferenceType)
                SetProperty(ReferenceProperty,_reference.ReferenceType,value)
            End Set
        End Property


The "Model" montors for changes to the property in "Relation" and fires OnPropertyChanged("string name of property") on itself to fire the business rules on itself in case it's changed elsewhere. The property in Relation and the property in Model have the same string name:


Private Sub ReferencePropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) Handles _reference.PropertyChanged
            If Me.GetType.GetMembers.Select(Function(m) m.Name).Contains(e.PropertyName) Then
                OnPropertyChanged(e.PropertyName)
            End If
        End Sub


The problem is that firing this OnPropertyChanged doesn't fire the business rules tied to the Model property any more. I can fire the business rule manually by adding a little more reflection and that works fine:


Dim prop As IPropertyInfo = FindProperty(e.PropertyName)
If prop IsNot Nothing Then
         BusinessRules.CheckRules(prop)
End If


Whenever I need to use reflection though I run under the assumption I must be doing something wrong. Is there something extra I need to do to have validation rules fire OnPropertyChanged for private backing fields?


 

Tuesday, October 14, 2014  |  From CSLA .NET Contrib

I'm curious to see if anyone has looked at the new vNext platform and how it will affect CSLA. One of the big things I noticed is the removal of HttpContext.Current and other static properties. It seems like they are going all in on the idea of dependency injection and essentially creating a scope per request.


This seems like a major change when it comes to CSLA contexts and other things. Any thoughts or comments?

Tuesday, October 14, 2014  |  From CSLA .NET Contrib

I'm trying to run PT MVC without the WCFAppServer project - would like to run the PT as single website and communicate directly with database.


I've copied the connectionStrings, appSettings and membership stuff from the web.config of the WCFAppServer website to the web.config of the MVC website. (I've done something like this back in the day with WindowsForms which worked).


Everything compiles but when I login in the MVC app I get this error:


"An exception of type 'Csla.DataPortalException' occurred in Csla.dll but was not handled in user code.  Additional information: DataPortal.Fetch failed (Type ProjectTracker.DalEf.DalManager,ProjectTracker.DalEf could not be found)"


I assume the problem is in my web.config file, so I've attached it. Another pair of eyes would be much appreciated.


Thanks

Tuesday, October 14, 2014  |  From CSLA .NET Contrib

Hi,


In the nuget documentation it states: 


"Note - Although not dependant on any specific version of Caliburn.Micro, the ViewModel adapter uses code from v.1.5.1."


I understand the library is done by Tiago Freitas Leal. After searching this forum there are no recent posts concerning this.


Is it possible to use CM 2.0 with this library?


If so, does ScreenWithModel<T> replace ViewModel<T> used in the books and MVVM video series?


When would I use ScreenWithModelBase<T>?


When would I use ScreenWithSubject<T>?


After extensive Googling I was unable to find documentation for this. Does it exist?


Thanks,


Matthew


 


 

Saturday, October 11, 2014  |  From CSLA .NET Contrib

Hi everybody,


  maybe somebody can give me some advice ...


I wrote apps in Winforms and Silverlight for school administration and schools to be able to manipulate data of pupils, statistics etc. The common data pool is in SQL Server and school administration is working in a LAN and schools access data by a Silverlight client via internet. 


After a lot of reading and thinking we decided to rewrite the Silverlight client in MVC (5). Win 8.1 and the followers are not an option as many communities are on Win XP still and will stay with Win 7 as long as they can. So there will be no XAML and all the benefits of Silverlight in the new client. I never before had to do with Asp.Net (except the Silverlight part) and so a lot of learning is to come ..... 


Fortunately there is no hurry (until now) and I can take time to learn everything from the scratch. So here are some of my questions:


 - Is there a better option than going into MVC (HTML 5 / JS ) for our scenario ?


 - Do I have to use the built in Membership / Role providers in MVC or can I go on to use our built in security?Clients using the MVC app only are allowed to change their passwords - all other security management (create new users etc, ) is done by a perfectly working Winforms app. So if this was possible, I only had to write a login screen. This is working well in our Silverlight and Winform apps. There is a library creating the needed Csla Identity and Principal objects and handling the other login stuff.


- Are there any working - up to date (MVC 5 ) - CSLA samples (maybe even) using the http proxy with async data access. If you are new to this stuff, it is really hard to get the information you need out of the samples.


Of course I have the CSLA 4 books and videos.


   Hopefully someone can enlighten me


       TIA


         regards


             Uwe


 


 


 

Tuesday, October 07, 2014  |  From CSLA .NET Contrib

I am planning to use CSLA as the BL for a web API (similar to ASP.Net MVC). All of the requests to the API must be authenticated and I'm having trouble understanding how CSLA works in this scenario. My web API layer can manage to keep a session in process to identify incoming requests using a token in the HTTP header, so I can know who my users are once they have logged in. 


Once a request is made to my API I can pass the credentials to CSLA to authenticate the user. But after the user is authenticated, how do I maintain a session that CSLA is aware of so I don't have to authenticate the user on each request? Would I have to store and instance of the business layer in session state? Any help would be appreciated. 

Friday, October 03, 2014  |  From CSLA .NET Contrib

I have a need for a business rule that changes the value of a property, while at the same time validates a second property.  The rules I've written so far have either changed or validated but not both, so I'm not sure if Csla will handle this correctly.  Would a rule that modifies one property and add an error result to another (the primary property) function as expected, or is this against how the framework is designed?

Wednesday, October 01, 2014  |  From CSLA .NET Contrib

Hi,


I noticed this project (https://github.com/MarimerLLC/cslajs) and wondering what the goal and status of the project is.


Is to building a JavaScript client for CSLA?


See related discussion regarding WcfProxy and HttpProxy: http://forums.lhotka.net/forums/p/12715/57646.aspx#57646


Thanks very much, Kurt

Tuesday, September 30, 2014  |  From CSLA .NET Contrib

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From CSLA .NET Contrib

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From CSLA .NET Contrib

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From CSLA .NET Contrib

Instead i load DataReader from syntax:



OleDbCommand cmd = new OleDbCommand(sSQL, Connl); 


OleDbDataReader dr = cmd.ExecuteReader();



 


now I want to put on the list DataTable list DataReader, how I want to find relationships syntax ?



public void DataReader(DataTable input) 


{ input .... ??? 


  OleDbDataReader dr = cmd.ExecuteReader();


  ... 


}


Tuesday, September 30, 2014  |  From CSLA .NET Contrib

Instead i load DataReader from syntax:



OleDbCommand cmd = new OleDbCommand(sSQL, Connl); 


OleDbDataReader dr = cmd.ExecuteReader();



 


now I want to put on the list DataTable list DataReader, how I want to find relationships syntax ?



public void DataReader(DataTable input) 


{ input .... ??? 


  OleDbDataReader dr = cmd.ExecuteReader();


  ... 


}


Tuesday, September 30, 2014  |  From CSLA .NET Contrib

Instead i load DataReader from syntax:



OleDbCommand cmd = new OleDbCommand(sSQL, Connl); 


OleDbDataReader dr = cmd.ExecuteReader();



 


now I want to put on the list DataTable list DataReader, how I want to find relationships syntax ?



public void DataReader(DataTable input) 


{ input .... ??? 


  OleDbDataReader dr = cmd.ExecuteReader();


  ... 


}


 CSLA .NET Contrib News Feed 

 Code-gen Templates News Feed 
Tuesday, October 21, 2014  |  From Code-gen Templates

I have asked this question before (twice, I think) but have never got an answer to the question:


Before upgrading from 4 to 4.5, exceptions coming back from the data portal would have the message of the original exception such as "Another user has modified the row in Table1, update failed".  Now all that comes back as the message is than an Async Error occurred (the message is blank and the exception is thrown from System.Runtime.CompilerServices.AsyncServices.<ThrowAsync>).  There is no detail as to the problem.  The Async exception doesn't contain the original exception:  there is no internal exception. 


If something happens on the server like it cannot connect to SQL Server or some UNC path doesn't exist, no message is returned to the UI to indicate the problem. 


I would REALLY like an example on how to get the exception back or an explanation of what I may be doing wrong. 


Thanks.


Todd

Tuesday, October 21, 2014  |  From Code-gen Templates

I have asked this question before (twice, I think) but have never got an answer to the question:


Before upgrading from 4 to 4.5, exceptions coming back from the data portal would have the message of the original exception such as "Another user has modified the row in Table1, update failed".  Now all that comes back as the message is than an Async Error occurred (the message is blank and the exception is thrown from System.Runtime.CompilerServices.AsyncServices.<ThrowAsync>).  There is no detail as to the problem.  The Async exception doesn't contain the original exception:  there is no internal exception. 


If something happens on the server like it cannot connect to SQL Server or some UNC path doesn't exist, no message is returned to the UI to indicate the problem. 


I would REALLY like an example on how to get the exception back or an explanation of what I may be doing wrong. 


Thanks.


Todd

Monday, October 20, 2014  |  From Code-gen Templates

I'm working with CSLA 4.5.601 and recently found out a bug in the Create of SimpleDataPortal. (I did something wrong but exception was hard to track because of this)


Exception was catched as expected to line 91:
catch (Exception ex) {
  ...
  throw 
DataPortal.NewDataPortalException(...


And after that run the finally:
finally{
    ApplicationContext
.DataPortalActivator.FinalizeInstance(obj.Instance);
}

But because obj was null exception was thrown from the finally block and the exception from the try/catch was 'lost'.


I've added a null check in the finally block which could prevent an issue like this in the future
finally{
  if (obj != null)
  ApplicationContext
.DataPortalActivator.FinalizeInstance(obj.Instance);
}

Would this be a nice fix?

Friday, October 17, 2014  |  From Code-gen Templates

Hi,


In my MVC 5-Project I want to use MS Identity for Authorization and Authentication. I have built my application according to the EncapsulatedDto-model, hence I among my projects have a Dal, DalSql, Library, and WcfPortal Project.  


I'm want to use Claims-based Authorization, and could of course put Everything in the MVC-Project since MS Identity with its EF-approach is separated from my other database,but then I break my separation of logic, so this is not the way to go as I see it.


I want to use the Identiy and Principal classes in CSLA, and separate all security logic from the UI-part, but am a Little unsure which way to go. The way I'm thinking is to have the usual Identity and Principal classes (inheriting from CslaIdentityBase and CslaPrincipal), in my Library Project, and then create a separate Concrete DalSqlEf-project which only handles the security parts.  


What are your comments on this?


Thanks,


Peter Centellini

Thursday, October 16, 2014  |  From Code-gen Templates

I have a Telerik Grid with sum totals on the footer.  When a value in a child is changed the Grid does not recalculate the total.  The Grid requires a CollectionChanged event.  Is there a way to fire the event even though the list really did not change?  Here is a code example that doesn't work because the event is not accessible:


 


        /// <summary>


        /// The on child changed.


        /// </summary>


        /// <param name="e">


        /// The event args.


        /// </param>


        protected override void OnChildChanged(Csla.Core.ChildChangedEventArgs e)


        {


            if (CollectionChanged != null)


            {


                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace));


            }


        }


 


Todd


 

Thursday, October 16, 2014  |  From Code-gen Templates

I've several projects spread out over VS2008 and VS2012.  Some of these projects are Silverlight projects/ASP/Windows Forms.   We'll be using Windows 7 for the foreseeable future.   Any advice when it comes to moving stuff over to a new technology?   What version of VS should I jump to and what would you recommend for a new desktop technology?   I really, really don't want to move everything to HTML.

Wednesday, October 15, 2014  |  From Code-gen Templates

I'm trying to move from WCF because of Windows Phone, my app needed the AuthorizeDataPortal to reconstruct the user so I get the information I need to continue.


 


It seems that the HTTP Proxy does not agree with the AuthorizeDataPortal, is there another way?


Everytime i try to use it i get back a NULL object from the HTTPProxy call


any pointers?


 


 

Tuesday, October 14, 2014  |  From Code-gen Templates

We are just upgrading from an older version of CSLA to the new framework (4.5.6) and having a little difficulty with one scenario.


I have a CSLA class (Model) referencing properties on another CSLA class (Relation) as a private backing field. The registration is setup like this:


Public Shared ReadOnly ReferenceProperty As PropertyInfo(Of ReferenceType) = RegisterProperty(Of ReferenceType)(Function(c) c.ReferenceType, "Reference Type", RelationshipTypes.PrivateField)
        Public Property ReferenceType() As ReferenceType
            Get
                Return GetProperty(ReferenceProperty,_reference.ReferenceType)
            End Get
            Set(ByVal value As ReferenceType)
                SetProperty(ReferenceProperty,_reference.ReferenceType,value)
            End Set
        End Property


The "Model" montors for changes to the property in "Relation" and fires OnPropertyChanged("string name of property") on itself to fire the business rules on itself in case it's changed elsewhere. The property in Relation and the property in Model have the same string name:


Private Sub ReferencePropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) Handles _reference.PropertyChanged
            If Me.GetType.GetMembers.Select(Function(m) m.Name).Contains(e.PropertyName) Then
                OnPropertyChanged(e.PropertyName)
            End If
        End Sub


The problem is that firing this OnPropertyChanged doesn't fire the business rules tied to the Model property any more. I can fire the business rule manually by adding a little more reflection and that works fine:


Dim prop As IPropertyInfo = FindProperty(e.PropertyName)
If prop IsNot Nothing Then
         BusinessRules.CheckRules(prop)
End If


Whenever I need to use reflection though I run under the assumption I must be doing something wrong. Is there something extra I need to do to have validation rules fire OnPropertyChanged for private backing fields?


 

Tuesday, October 14, 2014  |  From Code-gen Templates

I'm curious to see if anyone has looked at the new vNext platform and how it will affect CSLA. One of the big things I noticed is the removal of HttpContext.Current and other static properties. It seems like they are going all in on the idea of dependency injection and essentially creating a scope per request.


This seems like a major change when it comes to CSLA contexts and other things. Any thoughts or comments?

Tuesday, October 14, 2014  |  From Code-gen Templates

I'm trying to run PT MVC without the WCFAppServer project - would like to run the PT as single website and communicate directly with database.


I've copied the connectionStrings, appSettings and membership stuff from the web.config of the WCFAppServer website to the web.config of the MVC website. (I've done something like this back in the day with WindowsForms which worked).


Everything compiles but when I login in the MVC app I get this error:


"An exception of type 'Csla.DataPortalException' occurred in Csla.dll but was not handled in user code.  Additional information: DataPortal.Fetch failed (Type ProjectTracker.DalEf.DalManager,ProjectTracker.DalEf could not be found)"


I assume the problem is in my web.config file, so I've attached it. Another pair of eyes would be much appreciated.


Thanks

Tuesday, October 14, 2014  |  From Code-gen Templates

Hi,


In the nuget documentation it states: 


"Note - Although not dependant on any specific version of Caliburn.Micro, the ViewModel adapter uses code from v.1.5.1."


I understand the library is done by Tiago Freitas Leal. After searching this forum there are no recent posts concerning this.


Is it possible to use CM 2.0 with this library?


If so, does ScreenWithModel<T> replace ViewModel<T> used in the books and MVVM video series?


When would I use ScreenWithModelBase<T>?


When would I use ScreenWithSubject<T>?


After extensive Googling I was unable to find documentation for this. Does it exist?


Thanks,


Matthew


 


 

Saturday, October 11, 2014  |  From Code-gen Templates

Hi everybody,


  maybe somebody can give me some advice ...


I wrote apps in Winforms and Silverlight for school administration and schools to be able to manipulate data of pupils, statistics etc. The common data pool is in SQL Server and school administration is working in a LAN and schools access data by a Silverlight client via internet. 


After a lot of reading and thinking we decided to rewrite the Silverlight client in MVC (5). Win 8.1 and the followers are not an option as many communities are on Win XP still and will stay with Win 7 as long as they can. So there will be no XAML and all the benefits of Silverlight in the new client. I never before had to do with Asp.Net (except the Silverlight part) and so a lot of learning is to come ..... 


Fortunately there is no hurry (until now) and I can take time to learn everything from the scratch. So here are some of my questions:


 - Is there a better option than going into MVC (HTML 5 / JS ) for our scenario ?


 - Do I have to use the built in Membership / Role providers in MVC or can I go on to use our built in security?Clients using the MVC app only are allowed to change their passwords - all other security management (create new users etc, ) is done by a perfectly working Winforms app. So if this was possible, I only had to write a login screen. This is working well in our Silverlight and Winform apps. There is a library creating the needed Csla Identity and Principal objects and handling the other login stuff.


- Are there any working - up to date (MVC 5 ) - CSLA samples (maybe even) using the http proxy with async data access. If you are new to this stuff, it is really hard to get the information you need out of the samples.


Of course I have the CSLA 4 books and videos.


   Hopefully someone can enlighten me


       TIA


         regards


             Uwe


 


 


 

Tuesday, October 07, 2014  |  From Code-gen Templates

I am planning to use CSLA as the BL for a web API (similar to ASP.Net MVC). All of the requests to the API must be authenticated and I'm having trouble understanding how CSLA works in this scenario. My web API layer can manage to keep a session in process to identify incoming requests using a token in the HTTP header, so I can know who my users are once they have logged in. 


Once a request is made to my API I can pass the credentials to CSLA to authenticate the user. But after the user is authenticated, how do I maintain a session that CSLA is aware of so I don't have to authenticate the user on each request? Would I have to store and instance of the business layer in session state? Any help would be appreciated. 

Friday, October 03, 2014  |  From Code-gen Templates

I have a need for a business rule that changes the value of a property, while at the same time validates a second property.  The rules I've written so far have either changed or validated but not both, so I'm not sure if Csla will handle this correctly.  Would a rule that modifies one property and add an error result to another (the primary property) function as expected, or is this against how the framework is designed?

Wednesday, October 01, 2014  |  From Code-gen Templates

Hi,


I noticed this project (https://github.com/MarimerLLC/cslajs) and wondering what the goal and status of the project is.


Is to building a JavaScript client for CSLA?


See related discussion regarding WcfProxy and HttpProxy: http://forums.lhotka.net/forums/p/12715/57646.aspx#57646


Thanks very much, Kurt

Tuesday, September 30, 2014  |  From Code-gen Templates

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From Code-gen Templates

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From Code-gen Templates

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From Code-gen Templates

Instead i load DataReader from syntax:



OleDbCommand cmd = new OleDbCommand(sSQL, Connl); 


OleDbDataReader dr = cmd.ExecuteReader();



 


now I want to put on the list DataTable list DataReader, how I want to find relationships syntax ?



public void DataReader(DataTable input) 


{ input .... ??? 


  OleDbDataReader dr = cmd.ExecuteReader();


  ... 


}


Tuesday, September 30, 2014  |  From Code-gen Templates

Instead i load DataReader from syntax:



OleDbCommand cmd = new OleDbCommand(sSQL, Connl); 


OleDbDataReader dr = cmd.ExecuteReader();



 


now I want to put on the list DataTable list DataReader, how I want to find relationships syntax ?



public void DataReader(DataTable input) 


{ input .... ??? 


  OleDbDataReader dr = cmd.ExecuteReader();


  ... 


}


 Code-gen Templates News Feed 

 VS Templates News Feed 
Tuesday, October 21, 2014  |  From VS Templates

I have asked this question before (twice, I think) but have never got an answer to the question:


Before upgrading from 4 to 4.5, exceptions coming back from the data portal would have the message of the original exception such as "Another user has modified the row in Table1, update failed".  Now all that comes back as the message is than an Async Error occurred (the message is blank and the exception is thrown from System.Runtime.CompilerServices.AsyncServices.<ThrowAsync>).  There is no detail as to the problem.  The Async exception doesn't contain the original exception:  there is no internal exception. 


If something happens on the server like it cannot connect to SQL Server or some UNC path doesn't exist, no message is returned to the UI to indicate the problem. 


I would REALLY like an example on how to get the exception back or an explanation of what I may be doing wrong. 


Thanks.


Todd

Tuesday, October 21, 2014  |  From VS Templates

I have asked this question before (twice, I think) but have never got an answer to the question:


Before upgrading from 4 to 4.5, exceptions coming back from the data portal would have the message of the original exception such as "Another user has modified the row in Table1, update failed".  Now all that comes back as the message is than an Async Error occurred (the message is blank and the exception is thrown from System.Runtime.CompilerServices.AsyncServices.<ThrowAsync>).  There is no detail as to the problem.  The Async exception doesn't contain the original exception:  there is no internal exception. 


If something happens on the server like it cannot connect to SQL Server or some UNC path doesn't exist, no message is returned to the UI to indicate the problem. 


I would REALLY like an example on how to get the exception back or an explanation of what I may be doing wrong. 


Thanks.


Todd

Monday, October 20, 2014  |  From VS Templates

I'm working with CSLA 4.5.601 and recently found out a bug in the Create of SimpleDataPortal. (I did something wrong but exception was hard to track because of this)


Exception was catched as expected to line 91:
catch (Exception ex) {
  ...
  throw 
DataPortal.NewDataPortalException(...


And after that run the finally:
finally{
    ApplicationContext
.DataPortalActivator.FinalizeInstance(obj.Instance);
}

But because obj was null exception was thrown from the finally block and the exception from the try/catch was 'lost'.


I've added a null check in the finally block which could prevent an issue like this in the future
finally{
  if (obj != null)
  ApplicationContext
.DataPortalActivator.FinalizeInstance(obj.Instance);
}

Would this be a nice fix?

Friday, October 17, 2014  |  From VS Templates

Hi,


In my MVC 5-Project I want to use MS Identity for Authorization and Authentication. I have built my application according to the EncapsulatedDto-model, hence I among my projects have a Dal, DalSql, Library, and WcfPortal Project.  


I'm want to use Claims-based Authorization, and could of course put Everything in the MVC-Project since MS Identity with its EF-approach is separated from my other database,but then I break my separation of logic, so this is not the way to go as I see it.


I want to use the Identiy and Principal classes in CSLA, and separate all security logic from the UI-part, but am a Little unsure which way to go. The way I'm thinking is to have the usual Identity and Principal classes (inheriting from CslaIdentityBase and CslaPrincipal), in my Library Project, and then create a separate Concrete DalSqlEf-project which only handles the security parts.  


What are your comments on this?


Thanks,


Peter Centellini

Thursday, October 16, 2014  |  From VS Templates

I have a Telerik Grid with sum totals on the footer.  When a value in a child is changed the Grid does not recalculate the total.  The Grid requires a CollectionChanged event.  Is there a way to fire the event even though the list really did not change?  Here is a code example that doesn't work because the event is not accessible:


 


        /// <summary>


        /// The on child changed.


        /// </summary>


        /// <param name="e">


        /// The event args.


        /// </param>


        protected override void OnChildChanged(Csla.Core.ChildChangedEventArgs e)


        {


            if (CollectionChanged != null)


            {


                CollectionChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Replace));


            }


        }


 


Todd


 

Thursday, October 16, 2014  |  From VS Templates

I've several projects spread out over VS2008 and VS2012.  Some of these projects are Silverlight projects/ASP/Windows Forms.   We'll be using Windows 7 for the foreseeable future.   Any advice when it comes to moving stuff over to a new technology?   What version of VS should I jump to and what would you recommend for a new desktop technology?   I really, really don't want to move everything to HTML.

Wednesday, October 15, 2014  |  From VS Templates

I'm trying to move from WCF because of Windows Phone, my app needed the AuthorizeDataPortal to reconstruct the user so I get the information I need to continue.


 


It seems that the HTTP Proxy does not agree with the AuthorizeDataPortal, is there another way?


Everytime i try to use it i get back a NULL object from the HTTPProxy call


any pointers?


 


 

Tuesday, October 14, 2014  |  From VS Templates

We are just upgrading from an older version of CSLA to the new framework (4.5.6) and having a little difficulty with one scenario.


I have a CSLA class (Model) referencing properties on another CSLA class (Relation) as a private backing field. The registration is setup like this:


Public Shared ReadOnly ReferenceProperty As PropertyInfo(Of ReferenceType) = RegisterProperty(Of ReferenceType)(Function(c) c.ReferenceType, "Reference Type", RelationshipTypes.PrivateField)
        Public Property ReferenceType() As ReferenceType
            Get
                Return GetProperty(ReferenceProperty,_reference.ReferenceType)
            End Get
            Set(ByVal value As ReferenceType)
                SetProperty(ReferenceProperty,_reference.ReferenceType,value)
            End Set
        End Property


The "Model" montors for changes to the property in "Relation" and fires OnPropertyChanged("string name of property") on itself to fire the business rules on itself in case it's changed elsewhere. The property in Relation and the property in Model have the same string name:


Private Sub ReferencePropertyChanged(ByVal sender As Object, ByVal e As PropertyChangedEventArgs) Handles _reference.PropertyChanged
            If Me.GetType.GetMembers.Select(Function(m) m.Name).Contains(e.PropertyName) Then
                OnPropertyChanged(e.PropertyName)
            End If
        End Sub


The problem is that firing this OnPropertyChanged doesn't fire the business rules tied to the Model property any more. I can fire the business rule manually by adding a little more reflection and that works fine:


Dim prop As IPropertyInfo = FindProperty(e.PropertyName)
If prop IsNot Nothing Then
         BusinessRules.CheckRules(prop)
End If


Whenever I need to use reflection though I run under the assumption I must be doing something wrong. Is there something extra I need to do to have validation rules fire OnPropertyChanged for private backing fields?


 

Tuesday, October 14, 2014  |  From VS Templates

I'm curious to see if anyone has looked at the new vNext platform and how it will affect CSLA. One of the big things I noticed is the removal of HttpContext.Current and other static properties. It seems like they are going all in on the idea of dependency injection and essentially creating a scope per request.


This seems like a major change when it comes to CSLA contexts and other things. Any thoughts or comments?

Tuesday, October 14, 2014  |  From VS Templates

I'm trying to run PT MVC without the WCFAppServer project - would like to run the PT as single website and communicate directly with database.


I've copied the connectionStrings, appSettings and membership stuff from the web.config of the WCFAppServer website to the web.config of the MVC website. (I've done something like this back in the day with WindowsForms which worked).


Everything compiles but when I login in the MVC app I get this error:


"An exception of type 'Csla.DataPortalException' occurred in Csla.dll but was not handled in user code.  Additional information: DataPortal.Fetch failed (Type ProjectTracker.DalEf.DalManager,ProjectTracker.DalEf could not be found)"


I assume the problem is in my web.config file, so I've attached it. Another pair of eyes would be much appreciated.


Thanks

Tuesday, October 14, 2014  |  From VS Templates

Hi,


In the nuget documentation it states: 


"Note - Although not dependant on any specific version of Caliburn.Micro, the ViewModel adapter uses code from v.1.5.1."


I understand the library is done by Tiago Freitas Leal. After searching this forum there are no recent posts concerning this.


Is it possible to use CM 2.0 with this library?


If so, does ScreenWithModel<T> replace ViewModel<T> used in the books and MVVM video series?


When would I use ScreenWithModelBase<T>?


When would I use ScreenWithSubject<T>?


After extensive Googling I was unable to find documentation for this. Does it exist?


Thanks,


Matthew


 


 

Saturday, October 11, 2014  |  From VS Templates

Hi everybody,


  maybe somebody can give me some advice ...


I wrote apps in Winforms and Silverlight for school administration and schools to be able to manipulate data of pupils, statistics etc. The common data pool is in SQL Server and school administration is working in a LAN and schools access data by a Silverlight client via internet. 


After a lot of reading and thinking we decided to rewrite the Silverlight client in MVC (5). Win 8.1 and the followers are not an option as many communities are on Win XP still and will stay with Win 7 as long as they can. So there will be no XAML and all the benefits of Silverlight in the new client. I never before had to do with Asp.Net (except the Silverlight part) and so a lot of learning is to come ..... 


Fortunately there is no hurry (until now) and I can take time to learn everything from the scratch. So here are some of my questions:


 - Is there a better option than going into MVC (HTML 5 / JS ) for our scenario ?


 - Do I have to use the built in Membership / Role providers in MVC or can I go on to use our built in security?Clients using the MVC app only are allowed to change their passwords - all other security management (create new users etc, ) is done by a perfectly working Winforms app. So if this was possible, I only had to write a login screen. This is working well in our Silverlight and Winform apps. There is a library creating the needed Csla Identity and Principal objects and handling the other login stuff.


- Are there any working - up to date (MVC 5 ) - CSLA samples (maybe even) using the http proxy with async data access. If you are new to this stuff, it is really hard to get the information you need out of the samples.


Of course I have the CSLA 4 books and videos.


   Hopefully someone can enlighten me


       TIA


         regards


             Uwe


 


 


 

Tuesday, October 07, 2014  |  From VS Templates

I am planning to use CSLA as the BL for a web API (similar to ASP.Net MVC). All of the requests to the API must be authenticated and I'm having trouble understanding how CSLA works in this scenario. My web API layer can manage to keep a session in process to identify incoming requests using a token in the HTTP header, so I can know who my users are once they have logged in. 


Once a request is made to my API I can pass the credentials to CSLA to authenticate the user. But after the user is authenticated, how do I maintain a session that CSLA is aware of so I don't have to authenticate the user on each request? Would I have to store and instance of the business layer in session state? Any help would be appreciated. 

Friday, October 03, 2014  |  From VS Templates

I have a need for a business rule that changes the value of a property, while at the same time validates a second property.  The rules I've written so far have either changed or validated but not both, so I'm not sure if Csla will handle this correctly.  Would a rule that modifies one property and add an error result to another (the primary property) function as expected, or is this against how the framework is designed?

Wednesday, October 01, 2014  |  From VS Templates

Hi,


I noticed this project (https://github.com/MarimerLLC/cslajs) and wondering what the goal and status of the project is.


Is to building a JavaScript client for CSLA?


See related discussion regarding WcfProxy and HttpProxy: http://forums.lhotka.net/forums/p/12715/57646.aspx#57646


Thanks very much, Kurt

Tuesday, September 30, 2014  |  From VS Templates

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From VS Templates

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From VS Templates

Hi,


I've Always tried to make dto's correspond to a table in the database I'm using. But is it fair to say that a dto should rather correspond to the Query I'm using instead? Let's say you have a Reservation table, and then a ReservationDto which includes the fields Id, FacilityTypeId, StartDate, EndDate. where FacilityTypeId in the table is a foreign key to the FaciliType table from where I get the FacilityTypeName.


If I should be strict in using dto's to mirror the tables, then I also have to have a FacilityTypeDto in this scenario, but if I instead let my ReservationDto correspond to my Query, which uses a JOIN with my FacilityType table to get the FacilityTypeName I only have to Query the database for information once, hence making the whole thing simpler imo.


It would just be interesting to hear anyones thoughts in this.


Thanks,


Peter

Tuesday, September 30, 2014  |  From VS Templates

Instead i load DataReader from syntax:



OleDbCommand cmd = new OleDbCommand(sSQL, Connl); 


OleDbDataReader dr = cmd.ExecuteReader();



 


now I want to put on the list DataTable list DataReader, how I want to find relationships syntax ?



public void DataReader(DataTable input) 


{ input .... ??? 


  OleDbDataReader dr = cmd.ExecuteReader();


  ... 


}


Tuesday, September 30, 2014  |  From VS Templates

Instead i load DataReader from syntax:



OleDbCommand cmd = new OleDbCommand(sSQL, Connl); 


OleDbDataReader dr = cmd.ExecuteReader();



 


now I want to put on the list DataTable list DataReader, how I want to find relationships syntax ?



public void DataReader(DataTable input) 


{ input .... ??? 


  OleDbDataReader dr = cmd.ExecuteReader();


  ... 


}


 VS Templates News Feed 

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

Comments

No comments yet.