Search This Blog
Tuesday, April 3, 2018
Old entries in the XPObjectType table - YOUR FEEDBACK IS NEEDED!
Monday, March 26, 2018
Integrating UnitOfWork and XPObjectSpace descendants into an XAF app
How to map a property to a calculated database column (implement a read-only persistent property)
xpo and sql server identity fields
Using inherited UnitOfWork object
XAF: Create CreateCustomObjectSpaceProvider with parameters from login window
SecurityStrategyComplex: How to modify objects/properties in code when the user does not have the permission?
To learn more about low-level options to control how your application saves data and where, check out the How to customize the underlying database provider options and data access behavior in XAF.
Your feedback is needed!
Finally, I am just curious: if you search your entire solution in Visual Studio (Control+Shift+F) for any of the ": UnitOfWork", ": XPObjectSpace", ": XPObjectSpaceProvider" strings or their VB.NET equivalents (e.g., Inherits UnitOfWork), how many occurrences would you have and for what? Please let me know in the comments!
Monday, November 27, 2017
Welcome the DataStoreCreated event in the ConnectionDataStoreProvider and ConnectionStringDataStoreProvider classes
Wednesday, June 7, 2017
XPQuery changes regarding non-persistent properties in v17.1
Tuesday, March 14, 2017
XAF app performance: Reducing the number of simultaneous database connections
SELECT
DB_NAME(dbid) as DBName,
COUNT(dbid) as NumberOfConnections,
loginame as LoginName
FROM
sys.sysprocesses
WHERE
dbid > 0
GROUP BY
dbid, loginame
Thankfully, there is a couple of tricks to optimize your existing apps in production (they are already applied out of the box in new projects).
Monday, December 14, 2015
XPO ORM Data Model Designer and Wizard FAQ
Thursday, July 23, 2015
Making the AuditTrail functionality operate correctly with several XPObjectSpaceProviders when storing data in separate databases (15.1.6)
Friday, June 26, 2015
Creating associations between XPO data models in code using the XafTypesInfo API
The following snippet illustrates how to declare an association between two class' properties when you have no access to these classes code and cannot apply the AssociationAttribute directly.
| ||
ITypeInfo typeInfo1 = typesInfo.FindTypeInfo(typeof(DomainObject1));
ITypeInfo typeInfo2 = typesInfo.FindTypeInfo(typeof(DomainObject2));
IMemberInfo memberInfo1 = typeInfo1.FindMember("Object2");
IMemberInfo memberInfo2 = typeInfo2.FindMember("Object1s");
if(memberInfo1 == null) {
memberInfo1 = typeInfo1.CreateMember("Object2",
typeof(DomainObject2)
);
memberInfo1.AddAttribute(
new DevExpress.Xpo.AssociationAttribute("A",
typeof(DomainObject2)), true
);
}
if(memberInfo2 == null) {
memberInfo2 = typeInfo2.CreateMember("Object1s",
typeof(XPCollection<DomainObject1>)
);
memberInfo2.AddAttribute(
new DevExpress.Xpo.AssociationAttribute("A",
typeof(DomainObject1)), true
);
memberInfo2.AddAttribute(
new DevExpress.Xpo.AggregatedAttribute(), true
);
}
((XafMemberInfo)memberInfo1).Refresh();
((XafMemberInfo)memberInfo2).Refresh();
|
Thursday, March 19, 2015
Making sure a property value is unique with XAF and XPO
Application UI level
[RuleUniqueValue]
public string Name { ... }
This would be our topmost or basic protection level as it handles user input only. It will not help avoid duplicates if the same data records are created in code by a developer who did not call one of the Validator.RuleSet.ValidateXXX methods.
Thursday, March 12, 2015
How to map ORM data model to another schema, e.g. other than the default "dbo" in MS SQL Server?
Here we go:
Tuesday, March 3, 2015
Usability improvements for new XAF apps using XPO for data access
Here I will shortly outline solution details while you can see the full information by the links below:
T191131: DevExpress.Persistent.BaseImpl - Avoid problems caused by the fact that a new BaseObject record has an empty key value until it is saved
We do not modify the default value in the BaseObject class implementation to avoid the behavior change in existing applications.[C#]BaseObject.OidInitializationMode = OidInitializationMode.AfterConstruction;
S173546: Usability - Remove the necessity to manually call the CalculatedPersistentAliasHelper.CustomizeTypesInfo method from custom code when CalculatedPersistentAliasAttribute is used
Now, in XPO-based XAF solutions created with the Solution Wizard the following line is added to the overridden CustomizeTypesInfo method in the Module.cs file:[C#]CalculatedPersistentAliasHelper.CustomizeTypesInfo(typesInfo);
Thursday, December 25, 2014
Looking for practical experiences with both DevExpress XPO & ADO.NET Entity Framework
We do not provide comparisons of our products with competitors (mainly from an ethical point of view), but I think it would not hurt anyone if there was a list of proven opinions from users who had practical experience with both ORM tools. I already started collecting this list and among differences our users mentioned was, for instance:
Wednesday, August 6, 2014
Forcing Boolean Property Editor to work for a string DB column
Correcting data is not often possible, because this data can already be used by other information systems.
As you know, XAF automatically generates editors for data fields in the UI based on the field type in the ORM data model (learn more...), so in this particular case an inappropriate editor (text box) will be used if we leave the default mapping to a string column "as is" - a text box instead of a check box or drop down box with the Yes/No values. In this blog post I will show you several methods on how to work around this situation and have the correct editor in the UI while keeping the underlying data table schema and data unchanged.
Saturday, July 19, 2014
How to customize the underlying database provider options and data access behavior in XAF
I just wanted to repost my recent update to the corresponding article, because this information can interest some advanced XAF users.
IMPORTANT NOTE
So, if you just want to change the connection string, e.g. to use the Oracle instead of the Microsoft SQL Server database, then you would better refer to the Connect an XAF Application to a Database Provider article and documentation on your database provider instead. The XAF integration of supported ORM libraries is also described in the Business Model Design section of the framework's documentation.
Introducing IObjectSpaceProvider and IObjectSpace
XAF accesses data from a data store through special abstractions called - IObjectSpaceProvider and IObjectSpace.The IObjectSpace is an abstraction above the ORM-specific database context (e.g., the DBContext used in Entity Framework or the Session in XPO) allowing you to query or modify data.
The IObjectSpaceProvider is a provider/creator of IObjectSpace entities, which also manages which business types these IObjectSpace are supposed to work with, how to set up the underlying connection to the database, create and update it and other low level data access options.
An XafApplication can use one or several IObjectSpaceProvider objects at the same time, and you can access this information through the XafApplication.ObjectSpaceProvder or XafApplication.ObjectSpaceProviders properties. Check out these help links to learn more on how to plug in custom IObjectSpaceProvider objects a well.
There are several built-in implementations of the IObjectSpaceProvider and IObjectSpace interfaces in our framework, which are usually specific to a target ORM (Entity Framework or XPO). I suggest you check out the source code of the default framework classes to better understand the role of the IObjectSpaceProvider:
...\DevExpress.ExpressApp.EF\EFObjectSpaceProvider.cs
Wednesday, February 12, 2014
My Top 10 favorite DevExpress CodeRush features for .NET development in Visual Studio
This is my recent post on HabraHabr (a sort of TechCrunch in Russia) about my favorite CodeRush functions. If you do not understand Russian, try using Google Translate, Google Chrome or just watch the videos from this post.
Tuesday, October 1, 2013
How to generate a sequential and user-friendly identifier field within a business class
Monday, September 9, 2013
DevExpress.Xpo.v13.1.Extensions is now available for WCF Data Services 5.6
Microsoft is baking and selling new WCF Data Services versions like hot cookies lately, so we need to follow and provide separate versions of our OData extensions quite often for our customers:
Friday, April 19, 2013
The capability to not mark a persistent object as modified for saving if only its non-persistent properties were changed
I am not sure if this will be helpful for many XPO customers, but there is definitely a number of scenarios where you may welcome the implemented behavior. Refer to the tickets below to learn more.
http://www.devexpress.com/Support/Center/p/Q489119.aspx - implemented in 13.1 where you can use the new XpoDefault.IsObjectModifiedOnNonPersistentPropertyChange and Session.IsObjectModifiedOnNonPersistentPropertyChange properties.
http://www.devexpress.com/Support/Center/Question/Details/Q408356
http://www.devexpress.com/Support/Center/Issues/ViewIssue.aspx?issueid=S34863 - requested in the past by other customers.
Take special note that in the current version it is already possible to avoid change notifications for non-persistent properties by not using the OnChanged or SetPropertyValue methods in setters of your non-persistent properties.
Thursday, April 11, 2013
Recent XPO improvements to the visual designer and OData
Just a small update to to ensure that you have not missed the subject and added it to your development arsenal:
How to leverage the latter functionality is described at Exposing Domain Components (DC) via OData for mobile apps
As you probably know, the next maintenance update (12.2.8) is on its way. Once it is officially out, do not forget to check out its change log that contains information about both fixed issues and implemented suggestions, as well as updates to our documentation.
Wednesday, April 3, 2013
Exposing Domain Components (DC) via OData for mobile apps
View on screencast.com »











