A. Bekiaris's Blog
Παρουσίαση με Ετικέτες
Όλες οι Ετικέτε...
»
Xaf
»
Xpo
(RSS)
AOP
Code Generation
CodeSmith
Design Patterns
Devexpress
Template Engine
Validation
Xaf Tips
Xaf tip # 6 Linq your Session queries
17 Σεπτεμβρίου 09 04:07 μμ
|
tolisss
|
0 σχόλια
Pretty silent these days eh? I am working on a big refactoring on DictionaryDifference and have not much time to blog. But have another tip for my Xaf Tips series today maybe not strictly Xaf but is an XPO tip that you can use with your Xaf applications . The Problem Suppose your are a strongly typed fun like me or you want to use linq to query objects inside a transaction. In order linq to be used with XPO DevExpress provides XPQuery<T> class but unfortunately this do not support transactions. So the following test fails var work = new UnitOfWork(); new User(work){UserName = "Sam" }; User firstOrDefault = new XPQuery<User>(work).Where(user => user.UserName == "Sam" ).FirstOrDefault(); Assert.IsNotNull(firstOrDefault); The solution
Διαβάστε περισσότερα »
CodeSmith templates for Xaf
30 Ιουνίου 09 11:39 πμ
|
tolisss
|
0 σχόλια
Yes I know that is not the best practice. When using Xaf or Xpo you should first design your objects and let the framework create the database schema based on objects metadata (attributes). But there are many cases that the database is already design and you can not change it. What about those projects? Are you going to say to your customer that you do not want that project? Are you going to sit down and write all classes by hand? The best solution on this is to use some Template engine like Codesmith to create the initial implementation for you and then you can change them to meet your needs. You can also find a freeware version of Codesmith here Devexpress also has a persistent class generation Util which ca be invoked from the add new item form
Διαβάστε περισσότερα »
Validation Rule: At least one property is required
03 Ιουνίου 09 01:33 πμ
|
tolisss
|
0 σχόλια
Today i stump again upon the same problem . I wanted to throw a validation exception only if both of my properties do not have value. So lets create a validation rule for this one. More info on how we create custom validation rules can be found here Validation Module Since we are talking about multiple property values i think we should go with an attribute that is applied to a class and not to a property. Ok first we have to define that both our RuleBaseAttribute and RuleBaseProperties derived classes will implement . public interface IRuleRequiredForAtLeast1PropertyProperties { string MessageTemplateMustNotBeEmpty { get; set; } string Delimiters { get; set; } string TargetProperties { get; set; } } ok that looks nice lets explain what we have here for a bit.
Διαβάστε περισσότερα »
Automatic properties for Xpo
02 Ιουνίου 09 05:23 πμ
|
tolisss
|
0 σχόλια
The problem Xpo in order to support transactions implements some special kind of property setters like private string lastName; public string LastName { get { return lastName; } set { string oldValue = lastName; if (oldValue == value) return; lastName = value; OnChanged("Name", oldValue, value); } } Or a little more elegant like private string lastName; public string LastName { get { return lastName; } set { SetPropertyValue("LastName", ref lastName, value); } } Imagine you want to Design a fairly simple model like Customer –> Orders. A Customer should have LastName, FilrstName, Age and Orders as properties and Order only an Amount property. Using the above approach one could write the following code to describe the above model.
Διαβάστε περισσότερα »
Search
Go
Το Ιστολόγιο
Αρχική Σελίδα
Ετικέτες
13.2
ace.c9
AdditionalViewControlsProvider
anonymouslogin
AOP
application framework
aspect-oriented programming
AspxTreeListEditor
AuditTrail
BaseImpl
BDD
Blogging
breaking changes
C#
CodeRush
Cookies
Core.Web
Core.Win
dashboard
Design Patterns
Devexpress
DictionaryDifferenceStore
DX
DxCore
Dynamic Types
EasyTest
Email
Entity Framework
events
ExcelImporter
Exception Handling
eXpand
FilterDataStore
FireFox
FormsAuthentication
Free Microsoft
generate runtime member
github
Interfaces
IO
IOC
Irony
ListEditor
Live Writer
Logic
MapView
MasterDetail
MbUnit
MemberlevelSecurity
Merging
ModelArtifactState
ModelDifference
Montly_News
MSpec
NBehave
NCaousel
NCover
NDepend
open source
PivotChart
propertypathfilters
ProvidedAssociation
refactor
Release
releasev10
RememberMe
reports
Resharper
runtime members
Scheduler
Scripting
Security
source code
SqlDbMapper
statemachine
Strong Name
SubVersion
survey
SyntaxHighLighter
TDD
TeamCilty
TeamCity
Template Engine
TreeListEditors
TypeMock
Validation
video
view inheritance
ViewController
ViewVariants
Visual Studio plugins
WCF
WebSitePark
WF
WorldCreator
WorldCreator2
Xaf
Xaf Tips
Xpo
XVideoRental
Πλοήγηση
Αρχική σελίδα
Ιστολόγια
Συζητήσεις
Εκθέσεις Φωτογραφιών
Αρχειοθήκες
Ιστορικό Δημοσιεύσεων
Ιανουάριος 2019 (1)
Οκτώβριος 2018 (1)
Αύγουστος 2018 (1)
Ιούνιος 2018 (1)
Μάρτιος 2018 (1)
Αύγουστος 2017 (2)
Απρίλιος 2016 (1)
Ιούλιος 2014 (1)
Ιούνιος 2014 (1)
Απρίλιος 2014 (1)
Δεκέμβριος 2013 (1)
Νοέμβριος 2013 (7)
Οκτώβριος 2013 (6)
Σεπτέμβριος 2013 (4)
Αύγουστος 2013 (4)
Ιούλιος 2013 (7)
Μάιος 2013 (2)
Απρίλιος 2013 (2)
Μάρτιος 2013 (1)
Φεβρουάριος 2013 (2)
Ιανουάριος 2013 (5)
Δεκέμβριος 2012 (3)
Νοέμβριος 2012 (3)
Σεπτέμβριος 2012 (1)
Αύγουστος 2012 (2)
Μάιος 2012 (1)
Απρίλιος 2012 (1)
Μάρτιος 2012 (2)
Ιανουάριος 2012 (2)
Δεκέμβριος 2011 (4)
Νοέμβριος 2011 (1)
Σεπτέμβριος 2011 (5)
Αύγουστος 2011 (5)
Ιούνιος 2011 (1)
Απρίλιος 2011 (2)
Μάρτιος 2011 (1)
Φεβρουάριος 2011 (2)
Ιανουάριος 2011 (2)
Δεκέμβριος 2010 (3)
Νοέμβριος 2010 (3)
Οκτώβριος 2010 (3)
Σεπτέμβριος 2010 (8)
Αύγουστος 2010 (6)
Ιούλιος 2010 (1)
Μάιος 2010 (3)
Απρίλιος 2010 (5)
Μάρτιος 2010 (9)
Φεβρουάριος 2010 (5)
Ιανουάριος 2010 (3)
Δεκέμβριος 2009 (3)
Νοέμβριος 2009 (8)
Οκτώβριος 2009 (11)
Σεπτέμβριος 2009 (8)
Αύγουστος 2009 (8)
Ιούλιος 2009 (10)
Ιούνιος 2009 (21)
Συνδρομές
RSS 2.0
Atom 0.3